mirror of
https://github.com/bol-van/zapret.git
synced 2024-12-24 15:16:45 +00:00
51 lines
844 B
Bash
Executable File
51 lines
844 B
Bash
Executable File
#!/bin/sh
|
|
### BEGIN INIT INFO
|
|
# Provides: zapret
|
|
# Required-Start: $local_fs $network
|
|
# Required-Stop: $local_fs $network
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop: 0 1 6
|
|
### END INIT INFO
|
|
|
|
SCRIPT=$(readlink -f "$0")
|
|
EXEDIR=$(dirname "$SCRIPT")
|
|
ZAPRET_BASE=$(readlink -f "$EXEDIR/../..")
|
|
. "$EXEDIR/functions"
|
|
|
|
NAME=zapret
|
|
DESC=anti-zapret
|
|
|
|
case "$1" in
|
|
start)
|
|
zapret_run_daemons
|
|
[ "$INIT_APPLY_FW" != "1" ] || zapret_apply_firewall
|
|
;;
|
|
|
|
stop)
|
|
zapret_stop_daemons
|
|
[ "$INIT_APPLY_FW" != "1" ] || zapret_unapply_firewall
|
|
;;
|
|
|
|
start-fw)
|
|
zapret_apply_firewall
|
|
;;
|
|
stop-fw)
|
|
zapret_unapply_firewall
|
|
;;
|
|
|
|
start-daemons)
|
|
zapret_run_daemons
|
|
;;
|
|
stop-daemons)
|
|
zapret_stop_daemons
|
|
;;
|
|
|
|
*)
|
|
N=/etc/init.d/$NAME
|
|
echo "Usage: $N {start|stop|start-fw|stop-fw|start-daemons|stop-daemons}" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|