#! /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