dialog --title"Root overlay"--backtitle"$BACKTITLE"--yes-label"Disable"--no-label"Cancel"--yesno"\nYour system is already virtual read-only.\n\nDo you want to disable this feature and reboot?" 9 60
if[[-n$(service hostapd status | grep-w active | grep-w running)]];then
dialog --title"Hostapd service is running"--backtitle"$BACKTITLE"--help-button--help-label"Cancel"--yes-label"Stop"--no-label"Edit"--yesno"\nStop: stop and disable\n\nEdit: change basic parameters: SSID, password and channel" 9 70
[[$?= 0 ]]&& service hostapd stop &&sed-i"s/^DAEMON_CONF=.*/DAEMON_CONF=/" /etc/init.d/hostapd
[[$?= 1 ]]&& wlan_edit && service hostapd stop;sleep 1; service hostapd start
exitstatus=$?;
if[[$exitstatus= 0 ]];then service hostapd stop ;sed-i"s/^DAEMON_CONF=.*/DAEMON_CONF=/" /etc/init.d/hostapd;fi
if[[$exitstatus= 1 ]];then wlan_edit; service hostapd stop;sleep 1; service hostapd start;fi
else
# change special adapters to AP mode
wlan_exceptions "on"
...
...
@@ -239,7 +254,8 @@ while true; do
3)exit;;
255)exit;;
esac
dialog --title"Manually adjust network configuration if needed"--backtitle"$BACKTITLE"--ok-label"Reboot to apply new settings"--no-collapse--editbox$TEMP_CONF 30 0 2> $TEMP_CONF".tmp"
dialog --title"Manually adjust network configuration if needed"--backtitle"$BACKTITLE"\
--ok-label"Reboot to apply new settings"--no-collapse--editbox$TEMP_CONF 30 0 2> $TEMP_CONF".tmp"
if[[$?= 0 ]];then
mv$TEMP_CONF$NETWORK_CONF
reboot
...
...
@@ -265,22 +281,31 @@ while true; do
# scan for wifi modules
array=($(nmcli dev | grep"wifi" | awk'{print $1}'))
declared_wlans=0;
echo${#array[@]}
for i in"${array[@]}"
do
if grep--quiet"^iface $i" /etc/network/interfaces;then
let declared_wlans+=1
fi
done
if[$declared_wlans=${#array[@]}];then
dialog --title"Error"--backtitle"$BACKTITLE"--no-collapse--msgbox"\nWireless network is in use by if-up service. Remove it from config." 7 57
if[[-n$(service hostapd status | grep-w active | grep-w running)]];then
DIALOG_CANCEL=1
dialog --title"Hostapd service is running"--backtitle"$BACKTITLE"--help-button--help-label"Cancel"--yes-label"Stop"\
--no-label"Edit"--yesno"\nStop: stop and disable\n\nEdit: change basic parameters: SSID, password and channel" 9 70
exitstatus=$?;
if[[$exitstatus= 0 ]];then service hostapd stop ;sed-i"s/^DAEMON_CONF=.*/DAEMON_CONF=/" /etc/init.d/hostapd;fi
if[[$exitstatus= 1 ]];then wlan_edit; service hostapd stop;sleep 1; service hostapd start;fi