NDISwrapper Startscript

Aus Linupedia
Wechseln zu: Navigation, Suche

Dieses Startscript sollte in /etc/init.d eingefügt werden wenn aus irgendwechen Gründen der automatische Start von NDISwarpper beim booten nicht funktioniert. Nach einem "chmod 755 /etc/init.d/ndiswrapper" als User root sollte noch "insserv -v -d /etc/init.d/ndiswrapper" ausgeführt werden um es zu aktivieren.

#!/bin/sh
 #
 # Script to start/stop wireless
 #
 # Taken and modified from
 # http://ndiswrapper.sourceforge.net/phpwiki/index.php/StartupScripts
 #


 ### BEGIN INIT INFO
 # Provides:       ndiswrapper
 # Required-Start: $local_fs
 # Should-Start:
 # Required-Stop:
 # Should-Stop:
 # Default-Start:  2 3 5
 # Default-Stop:   0 1 6
 # Description:    Configure WLAN cards with Windows-based NDIS drivers
 ### END INIT INFO




 case $1 in
			start) echo -n "Starting ndiswrapper"
                 modprobe ndiswrapper
                 ifup wlan0
                 iwconfig wlan0 essid My_ssid
 #
 #Uncomment and modify the following line if you use WEP
 #                 iwconfig wlan0 key open
 #                 iwconfig wlan0 key 00000000000000000000000000
 #
 #Uncomment and modify the following line if you use static IPs
 #                 ip addr add MY_IP dev wlan0
 #                 ip route replace via MY_GATEWAY
 #
                 dhcpcd wlan0
                 iwconfig
              # Remember status and be verbose
                 rcstatus -v
			;;
 
			stop) echo -n "Shutting down ndiswrapper"
                 ifdown wlan0
                 modprobe -r ndiswrapper
                 rcstatus -v
			;;
         
			restart)
					## Stop the service and regardless of whether it was
					## running or not, start it again.
						$0 stop
						$0 start
					# Remember status and be quiet
						rc_status
			;;

			*)
						echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
						exit 1
			;;

 esac

--TomcatMJ 19:10, 29. Aug 2006 (CEST)