#!/bin/sh
# chkconfig: 2345 19 81
### BEGIN INIT INFO
# Provides:          wifi
# Required-Start:    $network
# Required-Stop:     $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start wpa_supplicant at boot time
# Description:       Enable service provided by wpa_supplicant.
# X-Start-Before:    
# X-Stop-After:      
# X-Timesys-Start-Number:  25
# X-Timesys-Stop-Number:  75
### END INIT INFO


PATH=/usr/bin:/bin:/usr/sbin:/sbin

case "$1" in
    start)
        echo "Adding managed wlan1 interface"
        iw phy0 interface add wlan1 type managed
    ;;
    stop)
        echo "Removing managed wlan1 interface"
        iw dev wlan1 del 
    ;;
    restart)
        $0 stop
        $0 start
    ;;
    *)
        echo "usage: $0 {start|stop|restart}"
    ;;
esac
