2015-02-05 03:14:41 +01:00
|
|
|
#!/bin/bash
|
2011-03-11 01:38:04 +01:00
|
|
|
#
|
2016-10-22 17:43:16 +02:00
|
|
|
# chkconfig: 345 92 92
|
2011-03-11 01:38:04 +01:00
|
|
|
# description: Starts Qubes Firewall monitor
|
|
|
|
#
|
|
|
|
# Source function library.
|
2017-09-30 04:56:02 +02:00
|
|
|
# shellcheck disable=SC1091
|
2011-03-11 01:38:04 +01:00
|
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
|
2016-10-22 17:43:16 +02:00
|
|
|
# Source Qubes library.
|
2017-09-30 04:56:02 +02:00
|
|
|
# shellcheck source=init/functions
|
2016-10-22 17:43:16 +02:00
|
|
|
. /usr/lib/qubes/init/functions
|
|
|
|
|
2013-03-13 02:26:40 +01:00
|
|
|
PIDFILE=/var/run/qubes/qubes-firewall.pid
|
2011-03-11 01:38:04 +01:00
|
|
|
|
|
|
|
start()
|
|
|
|
{
|
2016-10-22 17:43:16 +02:00
|
|
|
have_qubesdb || return
|
|
|
|
|
|
|
|
if qsvc qubes-firewall ; then
|
2011-03-11 01:38:04 +01:00
|
|
|
echo -n $"Starting Qubes Firewall monitor:"
|
|
|
|
/sbin/ethtool -K eth0 sg off
|
2013-03-13 02:26:40 +01:00
|
|
|
/usr/sbin/qubes-firewall &
|
2011-03-11 01:38:04 +01:00
|
|
|
success
|
|
|
|
echo ""
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
stop()
|
|
|
|
{
|
2011-10-01 02:49:25 +02:00
|
|
|
if [ -r $PIDFILE ]; then
|
2011-03-11 01:38:04 +01:00
|
|
|
echo -n "Stopping Qubes Firewall monitor:"
|
2017-09-30 04:49:21 +02:00
|
|
|
# shellcheck disable=SC2015
|
|
|
|
kill -9 "$(cat "$PIDFILE")" 2>/dev/null && success || failure
|
2011-03-11 01:38:04 +01:00
|
|
|
echo ""
|
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo $"Usage: $0 {start|stop}"
|
|
|
|
exit 3
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2017-09-30 04:49:21 +02:00
|
|
|
# shellcheck disable=SC2086
|
2011-03-11 01:38:04 +01:00
|
|
|
exit $RETVAL
|