summaryrefslogtreecommitdiff
path: root/scripts/vyatta-wanloadbalance.init
blob: 3e0c1e85354e0638c5a3cb45d2c3059a382c1f2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /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 /var/load-balance/wlb.conf -d -i $pid 1>/dev/null 
	start-stop-daemon --background --start --quiet --oknodo --exec /opt/vyatta/sbin/wan_lb -- -f /var/load-balance/wlb.conf -d -i $pid
}

stop ()
{
    if [ -f $pid ]
    then
	kill -s SIGTERM $( cat $pid ) 
   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