2011-03-11 01:38:04 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# chkconfig: 345 91 91
|
|
|
|
# description: Starts Qubes Firewall monitor
|
|
|
|
#
|
|
|
|
# Source function library.
|
|
|
|
. /etc/rc.d/init.d/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()
|
|
|
|
{
|
|
|
|
type=$(/usr/bin/xenstore-read qubes_vm_type)
|
2012-01-02 04:27:22 +01:00
|
|
|
start_firewall=$(/usr/bin/xenstore-read qubes-service/qubes-firewall 2> /dev/null)
|
2011-10-01 02:49:25 +02:00
|
|
|
if [ -z "$start_firewall" ] && [ "$type" == "ProxyVM" ] || [ "$start_firewall" == "1" ]; 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
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
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:"
|
2011-03-11 23:32:13 +01:00
|
|
|
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
|
|
|
|
|
|
|
|
exit $RETVAL
|