mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-30 05:50:53 +03:00
init.d: sysv restart commands
This commit is contained in:
parent
33be0cd8a0
commit
fe01f520a9
@ -15,15 +15,29 @@ ZAPRET_BASE=$(readlink -f "$EXEDIR/../..")
|
||||
NAME=zapret
|
||||
DESC=anti-zapret
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
do_start()
|
||||
{
|
||||
zapret_run_daemons
|
||||
[ "$INIT_APPLY_FW" != "1" ] || zapret_apply_firewall
|
||||
}
|
||||
do_stop()
|
||||
{
|
||||
zapret_stop_daemons
|
||||
[ "$INIT_APPLY_FW" != "1" ] || zapret_unapply_firewall
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
do_start
|
||||
;;
|
||||
|
||||
stop)
|
||||
zapret_stop_daemons
|
||||
[ "$INIT_APPLY_FW" != "1" ] || zapret_unapply_firewall
|
||||
do_stop
|
||||
;;
|
||||
|
||||
restart)
|
||||
do_stop
|
||||
do_start
|
||||
;;
|
||||
|
||||
start-fw)
|
||||
@ -33,16 +47,25 @@ case "$1" in
|
||||
zapret_unapply_firewall
|
||||
;;
|
||||
|
||||
restart-fw)
|
||||
zapret_unapply_firewall
|
||||
zapret_apply_firewall
|
||||
;;
|
||||
|
||||
start-daemons)
|
||||
zapret_run_daemons
|
||||
;;
|
||||
stop-daemons)
|
||||
zapret_stop_daemons
|
||||
;;
|
||||
restart-daemons)
|
||||
zapret_stop_daemons
|
||||
zapret_run_daemons
|
||||
;;
|
||||
|
||||
*)
|
||||
N=/etc/init.d/$NAME
|
||||
echo "Usage: $N {start|stop|start-fw|stop-fw|start-daemons|stop-daemons}" >&2
|
||||
echo "Usage: $N {start|stop|restart|start-fw|stop-fw|restart-fw|start-daemons|stop-daemons|restart-daemons}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user