summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMichael Larson <slioch@eng-140.vyatta.com>2008-02-20 06:13:29 -0800
committerMichael Larson <slioch@eng-140.vyatta.com>2008-02-20 06:13:29 -0800
commit3c8cf7007a189ff51283c5bc2fdbf319adade7df (patch)
treeb901506eddb92a9564b2feabab7797afe63d6ca6 /scripts
parenta03e5e4e250969c559df2c3bd986613a28c5486a (diff)
downloadvyatta-wanloadbalance-3c8cf7007a189ff51283c5bc2fdbf319adade7df.tar.gz
vyatta-wanloadbalance-3c8cf7007a189ff51283c5bc2fdbf319adade7df.zip
added vyatta-wanloadbalance.init
Diffstat (limited to 'scripts')
-rw-r--r--scripts/vyatta-wanloadbalance.init30
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/vyatta-wanloadbalance.init b/scripts/vyatta-wanloadbalance.init
new file mode 100644
index 0000000..decb811
--- /dev/null
+++ b/scripts/vyatta-wanloadbalance.init
@@ -0,0 +1,30 @@
+#! /bin/bash
+
+declare progname=${0##*/}
+declare action=$1; shift
+
+conf=$1; shift
+pid=/var/run/vyatta/wlb.pid
+
+test -x $bb || exit 0
+
+start ()
+{
+ /opt/vyatta/sbin/wan_lb -f $conf -d -i $pid
+}
+
+stop ()
+{
+ if [ -f $pid ]
+ then
+ kill -s SIGTERM $( cat $pid ) 2>/dev/null
+ fi
+}
+
+case "$action" in
+ start) start;;
+ stop) stop;;
+ restart) stop; sleep 1; start;;
+ *) echo "Usage: $progname {start|stop|restart}"
+ exit 1
+esac