#! /bin/bash ### BEGIN INIT INFO # Provides: vyatta-wanloadbalnce # Required-Start: $network $remote_fs $syslog # Required-Stop: $network $remote_fs $syslog # Default-Start: # Default-Stop: # Short-Description: Vyatta WAN loadbalance service ### END INIT INFO declare progname=${0##*/} declare action=$1; shift conf=$1; shift pid=/var/run/vyatta/wlb.pid test -x $bb || exit 0 start () { if [ -n "$conf" ] ; then /opt/vyatta/sbin/wan_lb -f $conf -d -i $pid 2>/dev/null else /opt/vyatta/sbin/wan_lb -f /var/run/load-balance/wlb.conf -d -i $pid 2>/dev/null fi } stop () { if [ -f $pid ] then kill -s SIGTERM $( cat $pid ) 2>/dev/null fi } case "$action" in start) start;; stop) stop;; force-reload) stop; sleep 1; start;; restart) stop; sleep 1; start;; *) echo "Usage: $progname {start|stop|restart}" exit 1 esac