Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 234745 Details for
Bug 309277
Use of bashisms in asterisk init.d script breaks the wrapper function
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Remove bashisms from init.d/asterisk (errata 2)
asterisk.initd-remove-bashisms.patch (text/plain), 2.98 KB, created by
Federico Santulli
on 2010-06-09 17:58:41 UTC
(
hide
)
Description:
Remove bashisms from init.d/asterisk (errata 2)
Filename:
MIME Type:
Creator:
Federico Santulli
Created:
2010-06-09 17:58:41 UTC
Size:
2.98 KB
patch
obsolete
>--- /etc/init.d/asterisk 2010-03-13 16:43:45.369804886 +0000 >+++ asterisk.initd 2010-03-13 16:46:49.929441740 +0000 >@@ -11,11 +11,11 @@ > } > > is_running() { >- if [ -z "$(pidof asterisk)" ]; then >+ if [ -z "`pidof asterisk`" ]; then > return 1 > else >- PID="$(cat /var/run/asterisk/asterisk.pid)" >- for x in $(pidof asterisk); do >+ PID="`cat /var/run/asterisk/asterisk.pid`" >+ for x in `pidof asterisk`; do > if [ "${x}" = "${PID}" ]; then > return 0 > fi >@@ -26,6 +26,8 @@ > } > > asterisk_run_loop() { >+ logger -t asterisk_wrapper "Initializing asterisk wrapper" >+ > local OPTS ARGS MSG NICE="" > local result=0 signal=0 > >@@ -33,10 +35,10 @@ > OPTS="-f" # don't fork / detach breaks wrapper script... > > # filter (redundant) arguments >- ARGS="$(echo "${@}" | sed -e "s:-c\|-f::g")" >+ ARGS="`echo "${@}" | sed -e "s:-c\|-f::g"`" > > # mangle yes/no options >- ASTERISK_CONSOLE="$(echo ${ASTERISK_CONSOLE} | tr '[:lower:]' '[:upper:]')" >+ ASTERISK_CONSOLE="`echo ${ASTERISK_CONSOLE} | tr '[:lower:]' '[:upper:]'`" > > if [ -n "${ASTERISK_CORE_SIZE}" ] && > [ "${ASTERISK_CORE_SIZE}" != "0" ]; then >@@ -115,10 +117,10 @@ > break > else > if [ $result -gt 128 ]; then >- signal=$((result - 128)) >+ signal=`expr $signal - 128` > MSG="Asterisk terminated with Signal: $signal" > >- CORE_TARGET="core-$(date "+%Y%m%d-%h%M%s")" >+ CORE_TARGET="core-`date +%Y%m%d-%H%M%S`" > > local CORE_DUMPED=0 > if [ -f "${ASTERISK_CORE_DIR}/core" ]; then >@@ -141,7 +143,7 @@ > > # kill left-over tasks > for X in ${ASTERISK_CLEANUP_ON_CRASH}; do >- kill -9 $(pidof ${X}); >+ kill -9 `pidof ${X}`; > done > fi > >@@ -176,8 +178,8 @@ > fi > > if [ -n "${ASTERISK_USER}" ]; then >- USER=$(echo $ASTERISK_USER | sed 's/:.*//') >- GROUP=$(echo $ASTERISK_USER | awk -F: '/.*:.*/ { print $2 }') >+ USER=`echo $ASTERISK_USER | sed 's/:.*//'` >+ GROUP=`echo $ASTERISK_USER | awk -F: '/.*:.*/ { print $2 }'` > if [ -n "${USER}" ]; then > ASTERISK_OPTS="${ASTERISK_OPTS} -U ${USER}" > fi >@@ -185,8 +187,8 @@ > ASTERISK_OPTS="${ASTERISK_OPTS} -G ${GROUP}" > GROUP=":${GROUP}" # make it look nice... > fi >- for element in $(find /var/{log,run}/asterisk); do >- if [ $(stat -c %U $element) != ${USER} ]; then >+ for element in `find /var/{log,run}/asterisk`; do >+ if [ `stat -c %U $element` != "${USER}" ]; then > ewarn "${USER} is not the owner of $element, fixing." > chown -R ${USER} /var/{log,run}/asterisk > chmod -R u+r /var/{log,run}/asterisk >@@ -198,7 +200,7 @@ > ebegin "Starting asterisk PBX (as root)" > fi > >- if [ "$(echo ${ASTERISK_WRAPPER} | tr '[:upper:]' '[:lower:]')" != "yes" ]; then >+ if [ "`echo ${ASTERISK_WRAPPER} | tr '[:upper:]' '[:lower:]'`" != "yes" ]; then > start-stop-daemon --start --exec /usr/sbin/asterisk \ > ${OPTS} -- ${ASTERISK_OPTS} > result=$? >@@ -231,7 +233,7 @@ > > if [ -r /var/run/asterisk/wrapper_loop.pid ]; then > ebegin "Killing wrapper script" >- kill $(</var/run/asterisk/wrapper_loop.pid) >+ kill `cat /var/run/asterisk/wrapper_loop.pid` > eend $? > fi >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 309277
:
223425
|
223427
| 234745