FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 06-30-2010, 10:13 PM
Thomas Bächler
 
Default bashify bringing up the loopback adaptor.

Am 30.06.2010 23:47, schrieb Victor Lowther:
> ---
> rc.sysinit | 9 ++++-----
> 1 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/rc.sysinit b/rc.sysinit
> index 1d16224..31636e5 100755
> --- a/rc.sysinit
> +++ b/rc.sysinit
> @@ -113,13 +113,12 @@ fi
> run_hook sysinit_udevsettled
>
> # bring up the loopback interface
> -if [ -d /sys/class/net/lo ]; then
> +if [[ -d /sys/class/net/lo ]]; then
> stat_busy "Bringing up loopback interface"
> - /sbin/ifconfig lo 127.0.0.1 up
> - if [ $? -ne 0 ]; then
> - stat_fail
> + if ! /sbin/ifconfig lo 127.0.0.1 up; then
> + stat_fail
> else
> - stat_done
> + stat_done
> fi
> fi
>

Hmm, this could be done with the status() function instead, right? No
need for stat_{busy,fail,done} then.
 
Old 06-30-2010, 10:26 PM
Victor Lowther
 
Default bashify bringing up the loopback adaptor.

On Thu, 2010-07-01 at 00:13 +0200, Thomas Bächler wrote:
> Am 30.06.2010 23:47, schrieb Victor Lowther:
> > ---
> > rc.sysinit | 9 ++++-----
> > 1 files changed, 4 insertions(+), 5 deletions(-)
> >
> > diff --git a/rc.sysinit b/rc.sysinit
> > index 1d16224..31636e5 100755
> > --- a/rc.sysinit
> > +++ b/rc.sysinit
> > @@ -113,13 +113,12 @@ fi
> > run_hook sysinit_udevsettled
> >
> > # bring up the loopback interface
> > -if [ -d /sys/class/net/lo ]; then
> > +if [[ -d /sys/class/net/lo ]]; then
> > stat_busy "Bringing up loopback interface"
> > - /sbin/ifconfig lo 127.0.0.1 up
> > - if [ $? -ne 0 ]; then
> > - stat_fail
> > + if ! /sbin/ifconfig lo 127.0.0.1 up; then
> > + stat_fail
> > else
> > - stat_done
> > + stat_done
> > fi
> > fi
> >
>
> Hmm, this could be done with the status() function instead, right? No
> need for stat_{busy,fail,done} then.

Probably. I was just looking for trivial bashification here -- I did
not look for further simplifications.


--
Victor Lowther
LPIC2 UCP RHCE
 

Thread Tools




All times are GMT. The time now is 01:20 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org