2009-10-07 16:17:09 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
START=90
|
|
|
|
|
|
|
|
DEFAULT=/etc/default/freeswitch
|
|
|
|
OPTIONS=""
|
|
|
|
|
2010-04-13 10:23:46 +00:00
|
|
|
boot() {
|
|
|
|
# Do nothing on boot
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2009-10-07 16:17:09 +00:00
|
|
|
start() {
|
|
|
|
[ -f $DEFAULT ] && . $DEFAULT
|
|
|
|
mkdir -p $FS_DIR_DB
|
2009-10-13 07:20:19 +00:00
|
|
|
mkdir -p $FS_DIR_LOG
|
2010-06-15 22:20:49 +00:00
|
|
|
ulimit -s 240
|
2010-06-27 13:36:27 +00:00
|
|
|
$FS_DIR/usr/bin/freeswitch $OPTIONS -nc
|
2009-10-07 16:17:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
[ -f $DEFAULT ] && . $DEFAULT
|
|
|
|
$FS_DIR/usr/bin/freeswitch $OPTIONS -stop
|
|
|
|
}
|
2010-06-27 13:36:24 +00:00
|
|
|
|
|
|
|
restart() {
|
|
|
|
# stopping freeswitch is non-blocking, so we wait until freeswitch's
|
|
|
|
# event socket is down, and then wait an additional ten seconds so that
|
|
|
|
# freeswitch should be completely shutdown before we start it again
|
|
|
|
local retval
|
|
|
|
stop
|
|
|
|
fs_cli -x status >/dev/null 2>&1
|
|
|
|
retval=$?
|
|
|
|
while [ $retval -eq 0 ]; do sleep 1; fs_cli -x status >/dev/null 2>&1; retval=$?; done
|
|
|
|
sleep 10
|
|
|
|
start
|
|
|
|
}
|
2010-06-27 13:36:27 +00:00
|
|
|
|