|
|
@ -62,7 +62,7 @@ then
|
|
|
|
PRIORITY=0
|
|
|
|
PRIORITY=0
|
|
|
|
message "safe_asterisk was started by `id -n` (uid `id -u`)."
|
|
|
|
message "safe_asterisk was started by `id -n` (uid `id -u`)."
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if `echo $OSTYPE | grep linux 2>&1 > /dev/null `
|
|
|
|
if `uname -s | grep Linux 2>&1 > /dev/null `
|
|
|
|
then
|
|
|
|
then
|
|
|
|
# maximum number of open files is set to the system maximum divided by two if
|
|
|
|
# maximum number of open files is set to the system maximum divided by two if
|
|
|
|
# MAXFILES is not set.
|
|
|
|
# MAXFILES is not set.
|
|
|
@ -75,7 +75,7 @@ else
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
SYSCTL_MAXFILES="fs.file-max"
|
|
|
|
SYSCTL_MAXFILES="fs.file-max"
|
|
|
|
elif `echo $OSTYPE | grep darwin 2>&1 > /dev/null `
|
|
|
|
elif `uname -s | grep Darwin 2>&1 > /dev/null `
|
|
|
|
then
|
|
|
|
then
|
|
|
|
SYSCTL_MAXFILES="kern.maxfiles"
|
|
|
|
SYSCTL_MAXFILES="kern.maxfiles"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -143,7 +143,7 @@ trap '' PIPE
|
|
|
|
if [ -d /etc/asterisk/startup.d ]; then
|
|
|
|
if [ -d /etc/asterisk/startup.d ]; then
|
|
|
|
for script in /etc/asterisk/startup.d/*.sh; do
|
|
|
|
for script in /etc/asterisk/startup.d/*.sh; do
|
|
|
|
if [ -x ${script} ]; then
|
|
|
|
if [ -x ${script} ]; then
|
|
|
|
source ${script}
|
|
|
|
. ${script}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -167,7 +167,7 @@ run_asterisk()
|
|
|
|
message "Asterisk shutdown normally."
|
|
|
|
message "Asterisk shutdown normally."
|
|
|
|
exit 0
|
|
|
|
exit 0
|
|
|
|
elif [ $EXITSTATUS -gt 128 ]; then
|
|
|
|
elif [ $EXITSTATUS -gt 128 ]; then
|
|
|
|
let EXITSIGNAL=EXITSTATUS-128
|
|
|
|
EXITSIGNAL=EXITSTATUS-128
|
|
|
|
echo "Asterisk exited on signal $EXITSIGNAL."
|
|
|
|
echo "Asterisk exited on signal $EXITSIGNAL."
|
|
|
|
if [ "$NOTIFY" != "" ]; then
|
|
|
|
if [ "$NOTIFY" != "" ]; then
|
|
|
|
echo "Asterisk on $MACHINE exited on signal $EXITSIGNAL. Might want to take a peek." | \
|
|
|
|
echo "Asterisk on $MACHINE exited on signal $EXITSIGNAL. Might want to take a peek." | \
|
|
|
|