asterisk init.d script uses bash specific features. Its trivial to make it run with busybox ash for embedded: diff -ruN data.orig/etc/init.d/asterisk data/etc/init.d/asterisk --- data.orig/etc/init.d/asterisk 2006-12-20 10:13:39 +0000 +++ data/etc/init.d/asterisk 2006-12-21 13:30:39 +0000 @@ -174,7 +174,7 @@ fi if [[ -n "${ASTERISK_USER}" ]]; then - USER=${ASTERISK_USER/:*/} + USER=$(echo $ASTERISK_USER | sed 's/:.*//') GROUP=$(echo $ASTERISK_USER | awk -F: '/.*:.*/ { print $2 }') if [[ -n "${USER}" ]]; then ASTERISK_OPTS="${ASTERISK_OPTS} -U ${USER}" @@ -191,15 +191,17 @@ if [[ "$(echo ${ASTERISK_WRAPPER} | tr [:upper:] [:lower:])" != "yes" ]]; then start-stop-daemon --start --exec /usr/sbin/asterisk \ ${OPTS} -- ${ASTERISK_OPTS} + result=$? else asterisk_run_loop ${ASTERISK_OPTS} 2>/dev/null & + result=$? fi if [[ $result -eq 0 ]]; then # 2 seconds should be enough for asterisk to start - sleep 2 - - result=$(is_running) + sleep 2 + is_running + result=$? fi eend $result
Created attachment 112700 [details, diff] 00-unbash.patch The patch also replaces all [[ with [
Just a note: solar@here ~ $ echo FooBar | tr [:upper:] [:lower:] FooBar solar@here ~ $ echo FooBar | tr '[:upper:]' '[:lower:]' foobar
(In reply to comment #2) > Just a note: > > solar@here ~ $ echo FooBar | tr [:upper:] [:lower:] > FooBar > solar@here ~ $ echo FooBar | tr '[:upper:]' '[:lower:]' > foobar > what shell is that? # busybox ash $ echo FooBar | tr [:upper:] [:lower:] foobar Should I submit a new patch?
> what shell is that? default shell was bash But I get the same behavior in both busybox and bash where it needs single ticks. > Should I submit a new patch? naa. I'll see if stkn is ok with me commiting your update. I or he will fix it then.
09 Mar 2007; <solar@gentoo.org> files/1.2.0/asterisk.rc6: - posix compliant init.d script from Natanael Copa. bug 170080 Thanks.