2015-02-05 03:14:41 +01:00
|
|
|
#!/bin/bash
|
2011-03-11 23:32:13 +01:00
|
|
|
#
|
|
|
|
# chkconfig: 345 92 92
|
|
|
|
# description: Starts Qubes Network monitor
|
|
|
|
#
|
|
|
|
# Source function library.
|
|
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
|
2013-03-13 02:26:40 +01:00
|
|
|
PIDFILE=/var/run/qubes/qubes-netwatcher.pid
|
2011-03-11 23:32:13 +01:00
|
|
|
|
|
|
|
start()
|
|
|
|
{
|
2013-06-07 05:20:55 +02:00
|
|
|
type=$(/usr/bin/qubesdb-read /qubes-vm-type)
|
|
|
|
start_netwatcher=$(/usr/bin/qubesdb-read /qubes-service/qubes-netwatcher 2>/dev/null)
|
2011-10-01 02:49:25 +02:00
|
|
|
if [ -z "$start_netwatcher" ] && [ "$type" == "ProxyVM" ] || [ "$start_netwatcher" == "1" ]; then
|
2011-03-11 23:32:13 +01:00
|
|
|
echo -n $"Starting Qubes Network monitor:"
|
|
|
|
/sbin/ethtool -K eth0 sg off
|
2013-03-13 02:26:40 +01:00
|
|
|
/usr/sbin/qubes-netwatcher &
|
2011-03-11 23:32:13 +01:00
|
|
|
success
|
|
|
|
echo ""
|
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
stop()
|
|
|
|
{
|
2011-10-01 02:49:25 +02:00
|
|
|
if [ -r "$PIDFILE" ]; then
|
2011-03-11 23:32:13 +01:00
|
|
|
echo -n "Stopping Qubes Network monitor:"
|
|
|
|
kill -9 $(cat $PIDFILE) 2>/dev/null && success || failure
|
|
|
|
echo ""
|
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo $"Usage: $0 {start|stop}"
|
|
|
|
exit 3
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit $RETVAL
|