[ILUG] bloody redhat network init scripts (and regex's)
Kevin O Riordan
koriordan at compsoc.com
Tue Jul 10 10:24:05 IST 2001
On Setting Orange, the 44th day of Confusion, Paul Jakma claimed:
> > if [ -n "$ORDERED_INTERFACES" ]; then
> > for i in $ORDERED_INTERFACES; do
> > action "Bringing up interface $i, in order " ./ifup $i boot
> > done
> > for i in $interfaces; do
> > if echo "$ORDERED_INTERFACES" | grep -v "$i" >/dev/null 2>&1 ; then
> > action "Bringing up interface $i " ./ifup $i boot
> what if the interface is already up? that's what my nested for is
> 'for'. or does ifup handle that gracefully?
The if...echo...grep line should make sure that anything in
ORDERED_INTERFACES isn't brought up again. There's no reason why
any of these devices should be up anyways, the script would only
be run at boot or changing runlevels, methinks.
ifup exits successfully if the device was already up, or so it would
seem from here. Could you send over your ifup ? This is (nominally)
an RH 6.1 box, and I don't think the network scripts were ever
upgraded or modified - it is possible that newer ones might behave
differently I guess.
> > (proposed) $ORDERED_INTERFACES variable would instinctively check the
> > relevant ifcfg- file as part of investigating an ifup failure.
If no argument is given to ifup, or if a ifcfg- file is not found, the
same error message is given. This seems silly, as they wrote the same
error message twice into the script.
rabbits, shoot can shoot I can fascists if I
More information about the ILUG