Fix init.d script
This commit is contained in:
parent
1f06c9f40f
commit
e110ca0a0f
1 changed files with 28 additions and 28 deletions
56
README.md
56
README.md
|
@ -108,38 +108,38 @@ sudo cp ./t38modem /usr/local/bin
|
|||
# /etc/init.d/t38modem
|
||||
|
||||
export LD_LIBRARY_PATH=/usr/local/lib
|
||||
export PTLIBPLUGINDIR=/usr/local/lib/ptlib-x.y.z:/usr/local/lib/opal-x.y.z # Adjust lib vers>
|
||||
export PTLIBPLUGINDIR=/usr/local/lib/ptlib-x.y.z:/usr/local/lib/opal-x.y.z # Adjust lib versions!
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
. /etc/t38modem/config
|
||||
# defines
|
||||
# - T38MODEM_SIP_USERNAME
|
||||
# - T38MODEM_SIP_PASSWORD
|
||||
# - T38MODEM_SIP_SERVER
|
||||
start)
|
||||
. /etc/t38modem/config
|
||||
# defines
|
||||
# - T38MODEM_SIP_USERNAME
|
||||
# - T38MODEM_SIP_PASSWORD
|
||||
# - T38MODEM_SIP_SERVER
|
||||
|
||||
COMMAND="t38modem -u 'T38modem' --ptty +/dev/ttyT38-1 --sip-proxy '${T38MODE>
|
||||
exec $COMMAND > /dev/null 2>&1 &
|
||||
PID=$!
|
||||
echo "Starting t38modem with pid $PID (pidfile /run/t38modem.pid)"
|
||||
echo $PID > /run/t38modem.pid
|
||||
;;
|
||||
stop)
|
||||
if [ ! -f "/run/t38modem.pid" ]; then
|
||||
echo "t38modem is not running! (/run/t38modem.pid does not exist)"
|
||||
exit 1
|
||||
fi
|
||||
COMMAND="t38modem -u 'T38modem' --ptty +/dev/ttyT38-1 --sip-proxy '${T38MODEM_SIP_USERNAME}:${T38MODEM_SIP_PASSWORD}@${T38MODEM_SIP_SERVER}' --sip-register '${T38MODEM_SIP_USERNAME}@${T38MODEM_SIP_SERVER},${T38MODEM_SIP_PASSWORD}' --sip-listen udp\$:5060 --route 't38:.*=sip:<dn>@${T38MODEM_SIP_SERVER}' --route 'sip:.*=t38:<dn>'"
|
||||
exec $COMMAND > /dev/null 2>&1 &
|
||||
PID=$!
|
||||
echo "Starting t38modem with pid $PID (pidfile /run/t38modem.pid)"
|
||||
echo $PID > /run/t38modem.pid
|
||||
;;
|
||||
stop)
|
||||
if [ ! -f "/run/t38modem.pid" ]; then
|
||||
echo "t38modem is not running! (/run/t38modem.pid does not exist)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n "Stopping t38modem pid: "
|
||||
PID=`cat /run/t38modem.pid`
|
||||
kill -9 $PID
|
||||
rm /run/t38modem.pid
|
||||
echo "${PID} Done"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
echo -n "Stopping t38modem pid: "
|
||||
PID=`cat /run/t38modem.pid`
|
||||
kill -9 $PID
|
||||
rm /run/t38modem.pid
|
||||
echo "${PID} Done"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Reference in a new issue