#!/bin/sh WPA_SUPPLICANT="/etc/wifi/wpa_supplicant.conf" SOCKETS="/var/run/wifidaemon" start() { printf "WifiManager starting..." # start wpa_supplicant server wpa_supplicant -iwlan0 -Dnl80211 -c $WPA_SUPPLICANT -O $SOCKETS -B } stop() { printf "stop WifiManager" killall wpa_supplicant } case "$1" in start) start ;; stop) stop;; restart|reload) stop start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac