You are not logged in.

#1 2007-04-18 21:42:49

iggy
Member
From: Germany, L.E. - Leipzig
Registered: 2004-10-17
Posts: 367

/etc/rc.d/network: bash script: how to find out, if there was an error

hello!

i want to write a bash script for my wireless lan. for this i need the information, if the network daemon has connected successfully or failed.
but there is a big problem: starting network success' every time, whether there was an error or not:

$ /etc/rc.d/network start
:: Starting network profile: 00wlan_home              [BUSY]
Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; No such device.
                                                                         [FAIL]
:: Starting Network                                             [DONE]
$ ls /var/run/daemons/
... network ...

can someone help me please? how can i realize  that "::Starting Network ..." also fails and the script returns an exit status 1?

thanks for your help, maybe we can improve the script. but i'm not a geek in bash! smile

mfg iggy


sorry for my bad english smile

Offline

#2 2007-04-19 07:38:21

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: /etc/rc.d/network: bash script: how to find out, if there was an error

iggy wrote:

hello!

i want to write a bash script for my wireless lan. for this i need the information, if the network daemon has connected successfully or failed.
but there is a big problem: starting network success' every time, whether there was an error or not:

$ /etc/rc.d/network start
:: Starting network profile: 00wlan_home              [BUSY]
Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; No such device.
                                                                         [FAIL]
:: Starting Network                                             [DONE]
$ ls /var/run/daemons/
... network ...

can someone help me please? how can i realize  that "::Starting Network ..." also fails and the script returns an exit status 1?

thanks for your help, maybe we can improve the script. but i'm not a geek in bash! smile

mfg iggy

try using netcfg to start the wireless profile, that should keep you happy until the new network scripts are unleashed... which won't have this problem.

James

Offline

#3 2007-04-19 20:17:27

iggy
Member
From: Germany, L.E. - Leipzig
Registered: 2004-10-17
Posts: 367

Re: /etc/rc.d/network: bash script: how to find out, if there was an error

iphitus wrote:

try using netcfg to start the wireless profile, that should keep you happy until the new network scripts are unleashed... which won't have this problem.

James

When will it be so far? I am curious already! wink

i have done it. wrote my own script using netcfg. thanks for your hint!

mfg iggy

Last edited by iggy (2007-04-19 20:19:19)


sorry for my bad english smile

Offline

Board footer

Powered by FluxBB