zapret/init.d/macos/zapret

52 lines
915 B
Plaintext
Raw Normal View History

2021-03-04 16:30:38 +05:00
#!/bin/sh
EXEDIR="$(dirname "$0")"
ZAPRET_BASE="$EXEDIR/../.."
ZAPRET_BASE="$(cd "$ZAPRET_BASE"; pwd)"
. "$EXEDIR/functions"
case "$1" in
start)
zapret_run_daemons
[ "$INIT_APPLY_FW" != "1" ] || zapret_apply_firewall
;;
stop)
[ "$INIT_APPLY_FW" != "1" ] || zapret_unapply_firewall
zapret_stop_daemons
;;
restart)
"$0" stop
"$0" start
;;
2022-02-15 19:15:36 +05:00
start-fw|start_fw)
2021-03-04 16:30:38 +05:00
zapret_apply_firewall
;;
2022-02-15 19:15:36 +05:00
stop-fw|stop_fw)
2021-03-04 16:30:38 +05:00
zapret_unapply_firewall
;;
2022-02-15 19:15:36 +05:00
restart-fw|stop_fw)
2021-03-04 16:30:38 +05:00
zapret_restart_firewall
;;
2022-02-15 19:15:36 +05:00
reload-fw-tables|reload_fw_tables)
2021-03-04 16:30:38 +05:00
pf_table_reload
;;
2022-02-15 19:15:36 +05:00
start-daemons|start_daemons)
2021-03-04 16:30:38 +05:00
zapret_run_daemons
;;
2022-02-15 19:15:36 +05:00
stop-daemons|stop_daemons)
2021-03-04 16:30:38 +05:00
zapret_stop_daemons
;;
2022-02-15 19:15:36 +05:00
restart-daemons|restart_daemons)
2021-03-04 16:30:38 +05:00
zapret_restart_daemons
;;
*)
N="$SCRIPT/$NAME"
echo "Usage: $N {start|stop|start-fw|stop-fw|restart-fw|reload-fw-tables|start-daemons|stop-daemons|restart-daemons}" >&2
exit 1
;;
esac