mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-23 22:45:39 +00:00
Let safe_asterisk take arguments (bug #2085)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
CLIARGS="$*" # Grab any args passed to safe_asterisk
|
||||||
TTY=9 # TTY (if you want one) for Asterisk to run on
|
TTY=9 # TTY (if you want one) for Asterisk to run on
|
||||||
CONSOLE=yes # Whether or not you want a console
|
CONSOLE=yes # Whether or not you want a console
|
||||||
#NOTIFY=ben@alkaloid.net # Who to notify about crashes
|
#NOTIFY=ben@alkaloid.net # Who to notify about crashes
|
||||||
@@ -42,10 +43,10 @@ run_asterisk()
|
|||||||
if [ "$TTY" != "" ]; then
|
if [ "$TTY" != "" ]; then
|
||||||
cd /tmp
|
cd /tmp
|
||||||
stty sane < /dev/${TTY}
|
stty sane < /dev/${TTY}
|
||||||
asterisk ${ASTARGS} >& /dev/${TTY} < /dev/${TTY}
|
asterisk ${CLIARGS} ${ASTARGS} >& /dev/${TTY} < /dev/${TTY}
|
||||||
else
|
else
|
||||||
cd /tmp
|
cd /tmp
|
||||||
asterisk ${ASTARGS}
|
asterisk ${CLIARGS} ${ASTARGS}
|
||||||
fi
|
fi
|
||||||
EXITSTATUS=$?
|
EXITSTATUS=$?
|
||||||
echo "Asterisk ended with exit status $EXITSTATUS"
|
echo "Asterisk ended with exit status $EXITSTATUS"
|
||||||
@@ -75,7 +76,7 @@ run_asterisk()
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "Automatically restarting Asterisk."
|
echo "Automatically restarting Asterisk."
|
||||||
sleep 1
|
sleep 4
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user