1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
5 DEFAULT=/etc/default/freeswitch
14 [ -f $DEFAULT ] && . $DEFAULT
18 $FS_DIR/usr/bin/freeswitch $OPTIONS -c &
22 [ -f $DEFAULT ] && . $DEFAULT
23 $FS_DIR/usr/bin/freeswitch $OPTIONS -stop
27 # stopping freeswitch is non-blocking, so we wait until freeswitch's
28 # event socket is down, and then wait an additional ten seconds so that
29 # freeswitch should be completely shutdown before we start it again
32 fs_cli -x status >/dev/null 2>&1
34 while [ $retval -eq 0 ]; do sleep 1; fs_cli -x status >/dev/null 2>&1; retval=$?; done