From: Arne Fitzenreiter Date: Thu, 21 Aug 2008 19:07:30 +0000 (+0200) Subject: Change Hostapd restart not leave master mode. X-Git-Tag: v2.3-beta4~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e9a31f2084dca486ac29cb2e492ae44471fe276;p=ipfire-2.x.git Change Hostapd restart not leave master mode. --- diff --git a/src/initscripts/init.d/hostapd b/src/initscripts/init.d/hostapd index aa714bb671..0f4a319f0b 100644 --- a/src/initscripts/init.d/hostapd +++ b/src/initscripts/init.d/hostapd @@ -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 2>&1 & + evaluate_retval + fi + ;; status)