2024-01-23 15:17:51 +05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# install prerequisites
|
|
|
|
|
|
|
|
EXEDIR="$(dirname "$0")"
|
|
|
|
EXEDIR="$(cd "$EXEDIR"; pwd)"
|
2024-08-25 19:49:15 +05:00
|
|
|
ZAPRET_BASE=${ZAPRET_BASE:-"$EXEDIR"}
|
|
|
|
ZAPRET_RW=${ZAPRET_RW:-"$ZAPRET_BASE"}
|
|
|
|
ZAPRET_CONFIG=${ZAPRET_CONFIG:-"$ZAPRET_RW/config"}
|
|
|
|
ZAPRET_CONFIG_DEFAULT="$ZAPRET_BASE/config.default"
|
|
|
|
|
|
|
|
[ -f "$ZAPRET_CONFIG" ] || {
|
|
|
|
ZAPRET_CONFIG_DIR="$(dirname "$ZAPRET_CONFIG")"
|
|
|
|
[ -d "$ZAPRET_CONFIG_DIR" ] || mkdir -p "$ZAPRET_CONFIG_DIR"
|
|
|
|
cp "$ZAPRET_CONFIG_DEFAULT" "$ZAPRET_CONFIG"
|
|
|
|
}
|
2024-01-23 15:17:51 +05:00
|
|
|
|
2024-07-31 11:48:50 +05:00
|
|
|
. "$ZAPRET_CONFIG"
|
2024-01-23 15:17:51 +05:00
|
|
|
. "$ZAPRET_BASE/common/base.sh"
|
|
|
|
. "$ZAPRET_BASE/common/elevate.sh"
|
|
|
|
. "$ZAPRET_BASE/common/fwtype.sh"
|
|
|
|
. "$ZAPRET_BASE/common/dialog.sh"
|
|
|
|
. "$ZAPRET_BASE/common/installer.sh"
|
|
|
|
. "$ZAPRET_BASE/common/ipt.sh"
|
|
|
|
|
|
|
|
umask 0022
|
|
|
|
fix_sbin_path
|
2024-01-25 22:47:08 +05:00
|
|
|
fsleep_setup
|
2024-01-23 19:08:50 +05:00
|
|
|
check_system accept_unknown_rc
|
2024-01-23 15:27:42 +05:00
|
|
|
[ $UNAME = "Linux" ] || {
|
2024-02-06 15:41:28 +05:00
|
|
|
echo no prerequisites required for $UNAME
|
|
|
|
exitp 0
|
2024-01-23 15:27:42 +05:00
|
|
|
}
|
2024-01-23 15:17:51 +05:00
|
|
|
require_root
|
|
|
|
|
|
|
|
case $UNAME in
|
|
|
|
Linux)
|
2024-01-23 15:27:42 +05:00
|
|
|
select_fwtype
|
2024-01-23 15:17:51 +05:00
|
|
|
case $SYSTEM in
|
|
|
|
openwrt)
|
2024-01-23 15:27:42 +05:00
|
|
|
select_ipv6
|
2024-01-23 15:17:51 +05:00
|
|
|
check_prerequisites_openwrt
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
check_prerequisites_linux
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exitp 0
|