diff options
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-x | rc.d/init.d/functions | 19 | ||||
-rwxr-xr-x | rc.d/init.d/network | 41 |
2 files changed, 14 insertions, 46 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 5b98cf76..ebfb2483 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -435,30 +435,21 @@ action() { # returns OK if $1 contains $2 strstr() { - #case "$1" in - # *${2}*) return 0 ;; - #esac - #return 1 - [ "$1" = "$2" ] && return 0 - slice=${1#*$2*} - [ "$slice" = "$1" ] && return 1 + [ "${1#*$2*}" = "$1" ] && return 1 return 0 } # Confirm whether we really want to run this service confirm() { - local YES=$"yY" - local NO=$"nN" - local CONT=$"cC" - while : ; do echo -n $"Start service $1 (Y)es/(N)o/(C)ontinue? [Y] " read answer - if strstr "$YES" "$answer" || [ "$answer" = "" ] ; then + if strstr $"yY" "$answer" || [ "$answer" = "" ] ; then return 0 - elif strstr "$CONT" "$answer" ; then + elif strstr $"cC" "$answer" ; then + rm -f /var/run/confirm return 2 - elif strstr "$NO" "$answer" ; then + elif strstr $"nN" "$answer" ; then return 1 fi done diff --git a/rc.d/init.d/network b/rc.d/init.d/network index 36d06a77..333c38d8 100755 --- a/rc.d/init.d/network +++ b/rc.d/init.d/network @@ -111,45 +111,22 @@ case "$1" in is_available $i continue fi - # If we're in confirmation mode, get user confirmation - [ -n "$CONFIRM" ] && - { - confirm $i - case $? in - 0) - : - ;; - 2) - CONFIRM= - ;; - *) - continue - ;; - esac - } - + # If we're in confirmation mode, get user confirmation. + if [ -f /var/run/confirm ]; then + confirm $i + test $? = 1 && continue + fi action $"Bringing up interface $i: " ./ifup $i boot done # Bring up CIPE VPN interfaces for i in $cipeinterfaces ; do if ! LANG=C egrep -L "^ONBOOT=['\"]?[Nn][Oo]['\"]?" ifcfg-$i >/dev/null 2>&1 ; then - # If we're in confirmation mode, get user confirmation - [ -n "$CONFIRM" ] && - { + # If we're in confirmation mode, get user confirmation. + if [ -f /var/run/confirm ]; then confirm $i - case $? in - 0) - : - ;; - 2) - CONFIRM= - ;; - *) - continue - ;; - esac - } + test $? = 1 && continue + fi action $"Bringing up interface $i: " ./ifup $i boot fi done |