2025-03-20 03:53:56 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2025-07-09 18:22:18 +03:00
|
|
|
source "/opt/zapret.installer/files/utils.sh"
|
|
|
|
|
source "/opt/zapret.installer/files/config.sh"
|
|
|
|
|
source "/opt/zapret.installer/files/init.sh"
|
|
|
|
|
source "/opt/zapret.installer/files/menu.sh"
|
|
|
|
|
source "/opt/zapret.installer/files/service.sh"
|
2025-07-09 17:26:47 +03:00
|
|
|
|
2025-03-20 03:53:56 +03:00
|
|
|
set -e
|
|
|
|
|
|
2025-06-14 14:30:32 +03:00
|
|
|
if [ "$(id -u)" -eq 0 ]; then
|
|
|
|
|
SUDO=""
|
|
|
|
|
else
|
|
|
|
|
if command -v sudo > /dev/null 2>&1; then
|
|
|
|
|
SUDO="sudo"
|
|
|
|
|
elif command -v doas > /dev/null 2>&1; then
|
|
|
|
|
SUDO="doas"
|
|
|
|
|
else
|
|
|
|
|
echo "Скрипт не может быть выполнен не от имени суперпользователя."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2025-03-20 03:53:56 +03:00
|
|
|
if [[ $EUID -ne 0 ]]; then
|
2025-06-14 14:30:32 +03:00
|
|
|
exec $SUDO "$0" "$@"
|
2025-03-20 03:53:56 +03:00
|
|
|
fi
|
2025-03-29 13:51:41 +03:00
|
|
|
check_openwrt
|
2025-04-02 21:44:08 +03:00
|
|
|
check_tput
|
2025-03-29 16:42:15 +03:00
|
|
|
$TPUT_B
|
2025-06-14 14:30:32 +03:00
|
|
|
check_fs
|
2025-03-20 14:58:09 +03:00
|
|
|
detect_init
|
|
|
|
|
main_menu
|