shell scripting
Colin Law
clanlaw at googlemail.com
Sat Nov 9 17:11:24 UTC 2013
On 9 November 2013 16:23, pluto mars <plutomars955 at gmail.com> wrote:
> Hi,
>
> I need some help with shell scripting (/bin/sh) in ubuntu.
>
> In a shell script I want to turn down an interface, say eth0 and then turn
> it up.
> So something like
>
> ifdown eth0
> ifup eth0
>
> But what I want in my shell script is to check and wait till eth0 is up and
> then start doing something next in my shell script.
> So something like "if ( eth0 not is up ) { sleep 1 }. But how do I do this
If no-knows a better way you could ping the router until it replies,
or ping the machine you want to connect to which would allow you to
cope with that machine being down also.
> in shell scripting ?
>
> And then also I want something similar for checking if syslog process is up
> or not. Because actually I am writing syslog through that interface to
> another computer. So I want to check if eth0 is up. If up, check if syslog
> process is up, if not start, if yes, write something to syslog.
Could you just look for the process?
Colin
More information about the ubuntu-users
mailing list