Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: f7574dabca
Fetching contributors…

Cannot retrieve contributors at this time

executable file 50 lines (42 sloc) 1.274 kb
#! /bin/sh
### BEGIN INIT INFO
# Provides: watch_gateway
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: watchs gateway change in xenstore
# Description: waits for gateway change in xenstore and updates default route
### END INIT INFO
DAEMON=/usr/bin/xenstore_watch
DAEMON_OPTS="/gateway ip route change default via %v"
NAME=watch_gateway
DESC=watch_gateway
PID_FILE=/var/run/watch_gateway.pid
test -x $DAEMON || exit 0
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --background --pidfile $PID_FILE --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --pidfile $PID_FILE
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --pidfile $PID_FILE
sleep 1
start-stop-daemon --start --background --pidfile $PID_FILE --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
Jump to Line
Something went wrong with that request. Please try again.