View previous topic :: View next topic |
Author |
Message |
Florian n00b
Joined: 26 May 2003 Posts: 4
|
Posted: Wed Apr 27, 2005 3:59 pm Post subject: How to hide scriptoutput at boot? |
|
|
Annoyed of not getting my USB Wlan Adaptor working by using the variety of configuration files, I made (which means: read & tried & erred & read & ...) some kind of script.
When it finally worked, I wanted it to be executed automatically at bootup.
As I'm quite a newbie to linux due to a lack of time (and the simplicity of OS X ) I simply used an existing initscript to do that and added it to the default runlevel.
Now I all the stuff written in the wlan-script is echoed at boot and reminds me of my kludgy workaround.
So how do i hide these messages?
Here's how I modified /etc/init.d/wlan:
Code: |
#!/sbin/runscript
source_config() {
if [ -f /etc/conf.d/wlanscript ]
then
source /etc/conf.d/wlanscript
else
return 1
fi
return 0
}
(...)
|
/etc/conf.d/wlanscript:
Code: |
#!/bin/bash
PATH=/sbin:$PATH
modprobe prism2_usb prism2_doreset=1
wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable
wlanctl-ng wlan0 lnxreq_autojoin ssid=****** authtype=sharedkey
wlanctl-ng wlan0 lnxreq_hostwep decrypt=true encrypt=true
wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKeyID=0
wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11ExcludeUnencrypted=true
wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11PrivacyInvoked=true
wlanctl-ng wlan0 dot11req_mibset mibattribute=dot11WEPDefaultKey0="**:**:**:**:**:**:**:**:**:**:**:**:**"
ifconfig wlan0 192.168.1.123 netmask 255.255.255.0 broadcast 192.168.1.255
ifconfig eth0 down
route add default gw 192.168.1.1
|
tia,
Florian |
|
Back to top |
|
|
hds Advocate
Joined: 21 Aug 2004 Posts: 2629 Location: Sprockhoevel [GER]
|
Posted: Wed Apr 27, 2005 4:03 pm Post subject: |
|
|
/sbin/runscript >/dev/null
might help
if not, you have to redirect every line in your wlanscript to /dev/null.
OTOH, you might want to see if there is an error in the script, then use ">/dev/null 2>&1" |
|
Back to top |
|
|
Florian n00b
Joined: 26 May 2003 Posts: 4
|
Posted: Wed Apr 27, 2005 4:19 pm Post subject: |
|
|
Perfect, "/sbin/runscript >/dev/null" gave me only more errors but redirecting every line of wlanscript works fine.
Thanks,
Florian |
|
Back to top |
|
|
|