mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-27 14:41:58 +00:00
safe_asterisk: Fix logging and sorting issue.
Re-enabled "TTY=9" which was erroneously disabled as part of a recent security fix and removed another logging "fix" that was added. Also added a sort to the "find" that enumerates the scripts to be sourced so they're sourced in the correct order. Resolves: #1539
This commit is contained in:
@@ -6,7 +6,7 @@ ASTVARRUNDIR="__ASTERISK_VARRUN_DIR__"
|
|||||||
ASTVARLOGDIR="__ASTERISK_LOG_DIR__"
|
ASTVARLOGDIR="__ASTERISK_LOG_DIR__"
|
||||||
|
|
||||||
CLIARGS="$*" # Grab any args passed to safe_asterisk
|
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=root@localhost # Who to notify about crashes
|
#NOTIFY=root@localhost # Who to notify about crashes
|
||||||
#EXEC=/path/to/somescript # Run this command if Asterisk crashes
|
#EXEC=/path/to/somescript # Run this command if Asterisk crashes
|
||||||
@@ -39,8 +39,6 @@ PRIORITY=0
|
|||||||
message() {
|
message() {
|
||||||
if test -n "$TTY" && test "$TTY" != "no"; then
|
if test -n "$TTY" && test "$TTY" != "no"; then
|
||||||
echo "$1" >/dev/${TTY}
|
echo "$1" >/dev/${TTY}
|
||||||
else
|
|
||||||
echo "$1" >&2
|
|
||||||
fi
|
fi
|
||||||
if test -n "$SYSLOG"; then
|
if test -n "$SYSLOG"; then
|
||||||
logger -p "${SYSLOG}.warn" -t safe_asterisk[$$] "$1"
|
logger -p "${SYSLOG}.warn" -t safe_asterisk[$$] "$1"
|
||||||
@@ -183,8 +181,7 @@ if test -d "${ASTETCDIR}/startup.d"; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for script in $(find "${ASTETCDIR}/startup.d/" -name '*.sh') ; do
|
for script in $(find "${ASTETCDIR}/startup.d/" -name '*.sh' | sort) ; do
|
||||||
echo sourceing
|
|
||||||
. "${script}"
|
. "${script}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user