-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinuxinfo.sh
More file actions
53 lines (47 loc) · 1.67 KB
/
linuxinfo.sh
File metadata and controls
53 lines (47 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# Перевірка наявності аргументу
if [ -z "$1" ]; then
LANG_open_auto_install_scripts="en"
else
LANG_open_auto_install_scripts="$1"
case "$LANG_open_auto_install_scripts" in
"en" | "ru" | "ua") ;;
*)
LANG_open_auto_install_scripts="en"
;;
esac
fi
URL_GITHUB="https://raw.githubusercontent.com"
REPO="zDimaBY/open_auto_install_scripts"
BRANCH="main"
SCRIPT_URLS=(
"$URL_GITHUB/$REPO/$BRANCH/scripts/functions_linux_info.sh"
"$URL_GITHUB/$REPO/$BRANCH/lang/${LANG_open_auto_install_scripts}/messages.sh"
)
# Функція для завантаження скрипта і виконання його
load_and_source_script() {
local downloader="$1"
local options="$2"
local url="$3"
if ! source <($downloader $options "$url"); then
exit 1
fi
}
# Перевірка наявності wget або curl
if command -v wget &>/dev/null; then
for url in "${SCRIPT_URLS[@]}"; do
load_and_source_script "wget" "--timeout=4 -qO-" "$url"
done
elif command -v curl &>/dev/null; then
for url in "${SCRIPT_URLS[@]}"; do
load_and_source_script "curl" "--max-time 4 -s" "$url"
done
else
echo "$MSG_ERROR_NO_DOWNLOAD_TOOL"
exit 1
fi
check_compatibility_script # Функція перевірки суміснусті скрипта з сервером
distribute_ips
check_info_server "full" # Функція перевірки інформації про сервер
check_info_control_panel # Функція перевірки панелі керування
check_available_services # Функція перевірки наявних служб та портів