| # submitted by Morgon Kanter |
| PATH=/bin:/usr/bin:/sbin:/usr/sbin |
| CONFFILE=/etc/vtund-start.conf |
| test -f $DAEMON || exit 0 |
| # find all the defined tunnels |
| egrep -v '^[:space:]*(#.*)?$' $CONFFILE | while true; |
| # no more lines available? done, then. |
| if [ $? != 0 ] ; then break; fi |
| SARGS=`echo $i|sed -ne 's/--server--\s*/-s -P /p'`; |
| echo "Starting vtund server." |
| start-stop-daemon --start --exec $DAEMON --pidfile $PIDPREFIX.pid -- $SARGS; |
| # split args into host and rest |
| HOST=`echo $i|cut -f 1 -d " "`; |
| TARGET=`echo $i|cut -f 2 -d " "`; |
| echo "Starting vtund client $HOST to $TARGET."; |
| start-stop-daemon --start --exec $DAEMON --pidfile $PIDPREFIX.$HOST.pid -- $i; |
| start-stop-daemon --stop --pidfile $i; |
| start-stop-daemon --stop --signal 1 --pidfile $i; |
| echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2 |