Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem mit init script
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
andreas2000
Tux's lil' helper
Tux's lil' helper


Joined: 02 Nov 2004
Posts: 144
Location: Austria/Vienna

PostPosted: Fri Nov 05, 2004 4:49 pm    Post subject: Problem mit init script Reply with quote

So, da bin ich nun schon wieder...

ich hab mir jetzt für meine WLan Geschichte ein eigenes init Script mit

Code:

start() {
.....
}

stop() {
.....
}

gebastelt.
Es funktioniert soweit auch ganz gut - hat allerdings einen kleinen Schönheitsfehler: jedesmal beim Booten des Rechners wird das stop ausgeführt, was natürlich nix bringt, da im stop ja nur die IP Adresse released wird und das Interface heruntergefahren wird.
Danach wird wie gewünscht auch das Start Script ausgeführt.

Kann das daran liegen, daß das wlan0 interface zuvor durch die modules (ipw2100) aktiviert wird? und wenn ja, wie kann ich das abstellen daß dadurch das Stop Script ausgeführt wird?

Das wars dann glaub ich mal an Infos die ich so gebraucht habe *gg*

Schönes Wochenende,

Andreas.
_________________
Registered Linux User 371244
Back to top
View user's profile Send private message
RealGeizt
l33t
l33t


Joined: 22 Apr 2003
Posts: 700

PostPosted: Fri Nov 05, 2004 5:04 pm    Post subject: Reply with quote

Poste doch mal dein Script.
Dann können wir vielleicht den Fehler orten :)
Habe nur minimale Erfahrung mit solchen Scripts.
Back to top
View user's profile Send private message
andreas2000
Tux's lil' helper
Tux's lil' helper


Joined: 02 Nov 2004
Posts: 144
Location: Austria/Vienna

PostPosted: Mon Nov 08, 2004 8:36 am    Post subject: Hier mal das Script... Reply with quote

Das hier ist mein Script...

Code:

#!/sbin/runscript
# Bringing up WLAN and connecting to available networks HOMEWLAN or WORKWLAN



start() {
 ebegin "Starting wlan0 - scanning for networks"
 hwl=$(/usr/sbin/iwlist wlan0 scan|grep HOMEWLAN)
 wwl=$(/usr/sbin/iwlist wlan0 scan|grep WORKWLAN)
 if [ -n "$hwl" ]; then
  einfo "connecting to HOMEWLAN"
  /usr/sbin/iwconfig wlan0 essid HOMEWLAN enc 12345678901234567890123456 open
  dhcpcd wlan0
  eend $?
  ipad=$(ifconfig wlan0|grep -m1 -o 'inet addr:[^ ]*'|cut -d: -f2)
  einfo "wlan0 received address ${ipad}"
 elif [ -n "$wwl; then
  einfo "connecting to WORKWLAN"
  /usr/sbin/iwconfig wlan0 essid WORKWLAN enc 12345678901234567890123456 open
  dhcpcd wlan0
  eend $?
  ipad=$(ifconfig wlan0|grep -m1 -o 'inet addr:[^ ]*'|cut -d: -f2)
  einfo "wlan0 received address ${ipad}"
 else
  einfo "no wireless networks found to connect to"
  eend 0
 fi
}



stop () {
 ebegin "Releasing DHCP lease for wlan0"
 /sbin/dhcpcd -z wlan0
 eend $?
 ebegin "Stopping wlan0"
 /sbin/ifconfig wlan0 down
 eend 0
}


und warum wird jetzt beim hochfahren das Stop Script ausgeführt und danach das Start Script?
_________________
Registered Linux User 371244
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum