2015-02-05 03:14:41 +01:00
|
|
|
#!/bin/bash
|
2011-03-11 23:32:13 +01:00
|
|
|
#
|
2016-10-22 17:43:16 +02:00
|
|
|
# chkconfig: 345 93 93
|
2011-03-11 23:32:13 +01:00
|
|
|
# description: Starts Qubes Network monitor
|
|
|
|
#
|
|
|
|
# Source function library.
|
|
|
|
. /etc/rc.d/init.d/functions
|
|
|
|
|
2016-10-22 17:43:16 +02:00
|
|
|
# Source Qubes library.
|
|
|
|
. /usr/lib/qubes/init/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()
|
|
|
|
{
|
2016-10-22 17:43:16 +02:00
|
|
|
have_qubesdb || return
|
|
|
|
|
|
|
|
if qsvc qubes-netwatcher ; 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
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|