diff options
Diffstat (limited to 'rc.single')
-rwxr-xr-x | rc.single | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -9,16 +9,16 @@ if [ "$PREVLEVEL" = "3" -o "$PREVLEVEL" = "5" ]; then # Shutdown daemons let i=${#DAEMONS[@]} - while [[ i -gt 0 ]]; do - if [[ $(echo ${DAEMONS[$i]} | /bin/grep '^[^\!]' | /usr/bin/wc -l) -eq 1 ]]; then - /etc/rc.d/${DAEMONS[$i]#@} stop + while [ $i -ge 0 ]; do + if [ "${DAEMONS[$i]:0:1}" != '!' ]; then + ck_daemon ${DAEMONS[$i]#@} || stop_daemon ${DAEMONS[$i]#@} fi let i=i-1 done - # find any leftover daemons and shut them down + # find any leftover daemons and shut them down in reverse order if [ -d /var/run/daemons ]; then - for daemon in $(/bin/ls /var/run/daemons); do - /etc/rc.d/$daemon stop + for daemon in $(/bin/ls -1t /var/run/daemons); do + stop_daemon $daemon done fi fi |