zapret/install_prereq.sh

45 lines
798 B
Bash
Raw Normal View History

2024-01-23 10:17:51 +00:00
#!/bin/sh
# install prerequisites
EXEDIR="$(dirname "$0")"
EXEDIR="$(cd "$EXEDIR"; pwd)"
ZAPRET_CONFIG="$EXEDIR/config"
ZAPRET_BASE="$EXEDIR"
2024-07-30 13:58:24 +00:00
[ -f "$ZAPRET_CONFIG" ] || cp "${ZAPRET_CONFIG}.default" "$ZAPRET_CONFIG"
. "$ZAPRET_CONFIG"
2024-01-23 10:17:51 +00: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 17:47:08 +00:00
fsleep_setup
check_system accept_unknown_rc
2024-01-23 10:27:42 +00:00
[ $UNAME = "Linux" ] || {
2024-02-06 10:41:28 +00:00
echo no prerequisites required for $UNAME
exitp 0
2024-01-23 10:27:42 +00:00
}
2024-01-23 10:17:51 +00:00
require_root
case $UNAME in
Linux)
2024-01-23 10:27:42 +00:00
select_fwtype
2024-01-23 10:17:51 +00:00
case $SYSTEM in
openwrt)
2024-01-23 10:27:42 +00:00
select_ipv6
2024-01-23 10:17:51 +00:00
check_prerequisites_openwrt
;;
*)
check_prerequisites_linux
;;
esac
;;
esac
exitp 0