Guest

/etc/rc.d/wifi

By: a guest on Jan 17th, 2011  |  syntax: Bash  |  size: 0.51 KB  |  hits: 85  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. #!/bin/bash
  2.  
  3. # /etc/rc.d/wifi
  4.  
  5. . /etc/rc.conf
  6. . /etc/rc.d/functions
  7.  
  8. case "$1" in
  9.   start)
  10.     stat_busy "Starting Wireless"
  11.     ifconfig wlan0 inet 192.168.1.35 up && iwconfig wlan0 essid RT2561_6 && (add_daemon wifi && stat_done) || stat_fail
  12.     ;;  
  13.   stop)
  14.     stat_busy "Stopping Wireless"
  15.     ifconfig wlan0 down && (rm_daemon wifi && stat_done) || stat_fail
  16.     ;;  
  17.   restart)
  18.     $0 stop
  19.     sleep 1
  20.     $0 start
  21.     ;;  
  22.   *)  
  23.     echo "usage: $0 {start|stop|restart}"  
  24. esac
  25. exit 0