2021-03-04 11:30:38 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# automated script for easy uninstalling zapret
|
|
|
|
|
|
|
|
EXEDIR="$(dirname "$0")"
|
|
|
|
EXEDIR="$(cd "$EXEDIR"; pwd)"
|
|
|
|
IPSET_DIR="$EXEDIR/ipset"
|
2022-02-15 14:15:36 +00:00
|
|
|
ZAPRET_CONFIG="$EXEDIR/config"
|
|
|
|
ZAPRET_BASE="$EXEDIR"
|
|
|
|
|
|
|
|
. "$ZAPRET_CONFIG"
|
|
|
|
. "$ZAPRET_BASE/common/base.sh"
|
|
|
|
. "$ZAPRET_BASE/common/elevate.sh"
|
|
|
|
. "$ZAPRET_BASE/common/fwtype.sh"
|
2022-04-03 17:59:58 +00:00
|
|
|
. "$ZAPRET_BASE/common/dialog.sh"
|
2022-02-15 14:15:36 +00:00
|
|
|
. "$ZAPRET_BASE/common/ipt.sh"
|
|
|
|
. "$ZAPRET_BASE/common/nft.sh"
|
|
|
|
. "$ZAPRET_BASE/common/pf.sh"
|
|
|
|
. "$ZAPRET_BASE/common/installer.sh"
|
2021-03-04 11:30:38 +00:00
|
|
|
|
|
|
|
remove_systemd()
|
|
|
|
{
|
2022-02-15 14:15:36 +00:00
|
|
|
clear_ipset
|
2021-03-04 11:30:38 +00:00
|
|
|
service_stop_systemd
|
|
|
|
service_remove_systemd
|
|
|
|
timer_remove_systemd
|
2022-02-15 14:15:36 +00:00
|
|
|
nft_del_table
|
2021-03-04 11:30:38 +00:00
|
|
|
crontab_del
|
|
|
|
}
|
|
|
|
|
2021-11-12 13:48:34 +00:00
|
|
|
remove_openrc()
|
|
|
|
{
|
2022-02-15 14:15:36 +00:00
|
|
|
clear_ipset
|
2021-11-12 13:48:34 +00:00
|
|
|
service_remove_openrc
|
2022-02-15 14:15:36 +00:00
|
|
|
nft_del_table
|
2021-11-12 13:48:34 +00:00
|
|
|
crontab_del
|
|
|
|
}
|
2021-03-04 11:30:38 +00:00
|
|
|
|
2021-11-15 15:14:33 +00:00
|
|
|
remove_linux()
|
|
|
|
{
|
2022-02-15 14:15:36 +00:00
|
|
|
INIT_SCRIPT_SRC="$EXEDIR/init.d/sysv/zapret"
|
2021-03-04 11:30:38 +00:00
|
|
|
|
2022-02-15 14:15:36 +00:00
|
|
|
clear_ipset
|
2021-03-04 11:30:38 +00:00
|
|
|
|
2022-02-15 14:15:36 +00:00
|
|
|
echo \* executing sysv init stop
|
|
|
|
"$INIT_SCRIPT_SRC" stop
|
2021-03-04 11:30:38 +00:00
|
|
|
|
2022-02-15 14:15:36 +00:00
|
|
|
nft_del_table
|
|
|
|
crontab_del
|
2021-03-04 11:30:38 +00:00
|
|
|
|
2022-02-15 14:15:36 +00:00
|
|
|
echo
|
|
|
|
echo '!!! WARNING. YOUR UNINSTALL IS INCOMPLETE !!!'
|
|
|
|
echo 'you must manually remove zapret auto start from your system'
|
2021-03-04 11:30:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
remove_openwrt()
|
|
|
|
{
|
|
|
|
OPENWRT_FW_INCLUDE=/etc/firewall.zapret
|
|
|
|
|
2022-02-15 14:15:36 +00:00
|
|
|
clear_ipset
|
2021-03-04 11:30:38 +00:00
|
|
|
service_remove_sysv
|
2022-02-15 14:15:36 +00:00
|
|
|
remove_openwrt_firewall
|
2021-03-04 11:30:38 +00:00
|
|
|
remove_openwrt_iface_hook
|
2022-02-15 14:15:36 +00:00
|
|
|
nft_del_table
|
|
|
|
restart_openwrt_firewall
|
2021-03-04 11:30:38 +00:00
|
|
|
crontab_del
|
|
|
|
}
|
|
|
|
|
|
|
|
remove_macos()
|
|
|
|
{
|
|
|
|
remove_macos_firewall
|
|
|
|
service_remove_macos
|
|
|
|
crontab_del
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-03-27 15:58:47 +00:00
|
|
|
fix_sbin_path
|
2021-03-04 11:30:38 +00:00
|
|
|
check_system
|
|
|
|
require_root
|
|
|
|
|
|
|
|
[ "$SYSTEM" = "macos" ] && . "$EXEDIR/init.d/macos/functions"
|
|
|
|
|
|
|
|
case $SYSTEM in
|
|
|
|
systemd)
|
|
|
|
remove_systemd
|
|
|
|
;;
|
2021-11-12 13:48:34 +00:00
|
|
|
openrc)
|
|
|
|
remove_openrc
|
|
|
|
;;
|
2021-11-15 15:14:33 +00:00
|
|
|
linux)
|
|
|
|
remove_linux
|
|
|
|
;;
|
2021-03-04 11:30:38 +00:00
|
|
|
openwrt)
|
|
|
|
remove_openwrt
|
|
|
|
;;
|
|
|
|
macos)
|
|
|
|
remove_macos
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
exitp 0
|