fi
fi
- # First reset to World (00) and then set new country
+ # First set to any country then reset to World (00)
+ # and then set new country because the card is only
+ # reprogrammed if the region was changed.
+ /usr/sbin/iw reg set DE
/usr/sbin/iw reg set 00
/usr/sbin/iw reg set $COUNTRY
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;
+ if [ -d /sys/class/net/${INTERFACE} ]; then
+ /usr/bin/hostapd -P /var/run/hostapd /etc/hostapd.conf >/dev/null 2>&1 &
+ else
+ ip link set ${INTERFACE}_man down
+ ip link set ${INTERFACE}_man name ${INTERFACE}
+ fi
exit 0;
else
echo_ok
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
;;