]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Change Hostapd restart not leave master mode.
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 21 Aug 2008 19:07:30 +0000 (21:07 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 21 Aug 2008 19:07:30 +0000 (21:07 +0200)
src/initscripts/init.d/hostapd

index aa714bb671bd86d17f575c594877a43a82fdc1ca..0f4a319f0bdd2098def953a8a0dde1c44a372620 100644 (file)
@@ -61,9 +61,24 @@ case "${1}" in
                 ;;
 
         restart)
-                ${0} stop
+               boot_mesg "Stopping hostapd..."
+                killproc /usr/bin/hostapd
+                evaluate_retval
+
                 sleep 1
-                ${0} start
+
+               boot_mesg "Starting hostapd... "
+               if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode:Master")" == "" ]; then
+                   boot_mesg "Error! Card is not master"
+                   echo_failure;
+                   exit 1;
+               else
+                   /usr/sbin/iwconfig $INTERFACE channel $CHANNEL
+                   /usr/sbin/iwconfig $INTERFACE txpower $TXPOWER
+                   /usr/bin/hostapd -P /var/run/hostapd /etc/hostapd.conf </dev/tty12 >/dev/tty12 2>&1 &
+                   evaluate_retval
+               fi
+
                 ;;
 
         status)