aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d
diff options
context:
space:
mode:
authorFlorian La Roche <laroche@redhat.com>2003-04-18 21:09:07 +0000
committerFlorian La Roche <laroche@redhat.com>2003-04-18 21:09:07 +0000
commita31c7a30dced003c0f96025fa76364eb523e832c (patch)
tree904347a550becd8209e41ad4f5dbd7f30d1ca0ff /rc.d/init.d
parent475e9481742a2dc8419909e0fd6e257dc9b3c404 (diff)
downloadinitscripts-a31c7a30dced003c0f96025fa76364eb523e832c.tar
initscripts-a31c7a30dced003c0f96025fa76364eb523e832c.tar.gz
initscripts-a31c7a30dced003c0f96025fa76364eb523e832c.tar.bz2
initscripts-a31c7a30dced003c0f96025fa76364eb523e832c.tar.xz
initscripts-a31c7a30dced003c0f96025fa76364eb523e832c.zip
- new releaser7-16
Diffstat (limited to 'rc.d/init.d')
-rwxr-xr-xrc.d/init.d/functions19
-rwxr-xr-xrc.d/init.d/network41
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