ovpn, uap0 compatibility; readme

This commit is contained in:
Taikuh
2020-03-15 19:02:20 +08:00
parent 5d57765669
commit 8082430c30
6 changed files with 24 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ NAME=raspap
DESC="Service control for RaspAP"
CONFIGFILE="/etc/raspap/hostapd.ini"
DAEMONPATH="/lib/systemd/system/raspap.service"
OPENVPNENABLED=$(pidof openvpn | wc -l)
positional=()
while [[ $# -gt 0 ]]
@@ -29,6 +30,7 @@ done
set -- "${positional[@]}"
echo "Stopping network services..."
systemctl stop openvpn-client@client
systemctl stop systemd-networkd
systemctl stop hostapd.service
systemctl stop dnsmasq.service
@@ -51,6 +53,9 @@ if [ -r "$CONFIGFILE" ]; then
ip link set down eth0
ip link set up eth0
echo "Removing uap0 interface..."
iw dev uap0 del
echo "Enabling systemd-networkd"
systemctl start systemd-networkd
systemctl enable systemd-networkd
@@ -87,5 +92,9 @@ sleep "${seconds}"
systemctl start dnsmasq.service
if [ $OPENVPNENABLED -eq 1 ]; then
systemctl start openvpn-client@client
fi
echo "RaspAP service start DONE"