From 57f42f201951ca95d528a594aef6f6197b82648f Mon Sep 17 00:00:00 2001 From: billz Date: Fri, 19 Apr 2019 11:35:03 +0000 Subject: [PATCH] Added check for WifiAPEnable flag --- installers/servicestart.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/installers/servicestart.sh b/installers/servicestart.sh index 9182ff15..8dc6184c 100755 --- a/installers/servicestart.sh +++ b/installers/servicestart.sh @@ -31,16 +31,19 @@ systemctl stop hostapd.service systemctl stop dnsmasq.service systemctl stop dhcpcd.service -echo "Removing uap0 interface..." -iw dev uap0 del +source <(grep = /etc/raspap/hostapd.ini | sed 's/ *= */=/g') +if [ $WifiAPEnable = 1 ]; then + if [ "${interface}" = "uap0" ]; then + echo "Removing uap0 interface..." + iw dev uap0 del -if [ "${interface}" = "uap0" ]; then - echo "Adding uap0 interface..." - iw dev wlan0 interface add uap0 type __ap + echo "Adding uap0 interface..." + iw dev wlan0 interface add uap0 type __ap - # Bring up uap0 interface - ifconfig uap0 up -fi + # Bring up uap0 interface + ifconfig uap0 up + fi +fi # Start services, mitigating race conditions echo "Starting hostapd service..."