]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
hostapd: create additional AP device if switch has failed.
authorArne Fitzenreiter <arne_f@ipfire.org>
Sun, 18 Jan 2015 20:29:53 +0000 (21:29 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sun, 18 Jan 2015 20:29:53 +0000 (21:29 +0100)
src/initscripts/init.d/hostapd

index 8f59a7f16fdb51c1fbe4c420eab4c89cba0d9a9b..357452cede860ef077fa4553413d3f500e83aab1 100644 (file)
@@ -106,8 +106,13 @@ case "${1}" in
                sleep 2
 
                if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode:Master")" == "" ]; then
-                       boot_mesg "Error! Can't set wlan master mode"
-                       echo_failure;
+                       killproc /usr/bin/hostapd > /dev/null 2>&1
+                       boot_mesg "Try to create additional AP device ..." 
+                       ip link set ${INTERFACE} down
+                       ip link set ${INTERFACE} name ${INTERFACE}_man
+                       iw dev  ${INTERFACE}_man interface add ${INTERFACE} type __ap
+                       evaluate_retval;
+                       /usr/bin/hostapd -P /var/run/hostapd /etc/hostapd.conf >/dev/null 2>&1 &
                        exit 0;
                else
                        echo_ok
@@ -116,7 +121,9 @@ case "${1}" in
 
        stop)
                boot_mesg "Stopping hostapd..."
-
+               ip link set ${INTERFACE} down > /dev/null 2>&1
+               ip link set ${INTERFACE} down_man > /dev/null 2>&1
+               sleep 1
                killproc /usr/bin/hostapd
                evaluate_retval
                ;;