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

@@ -325,7 +325,9 @@ function patch_system_files() {
"/bin/systemctl start dnsmasq.service"
"/bin/systemctl stop dnsmasq.service"
"/bin/systemctl start openvpn-client@client"
"/bin/systemctl enable openvpn-client@client"
"/bin/systemctl stop openvpn-client@client"
"/bin/systemctl disable openvpn-client@client"
"/bin/cp /tmp/ovpnclient.ovpn /etc/openvpn/client/client.conf"
"/bin/cp /tmp/authdata /etc/openvpn/client/login.conf"
"/bin/cp /tmp/dnsmasqdata /etc/dnsmasq.conf"

View File

@@ -34,7 +34,8 @@ lines=(
for line in "${lines[@]}"; do
if grep "$line" /etc/rc.local > /dev/null; then
else
echo "$line: Line already added"
else
sudo sed -i "s/^exit 0$/$line\nexit 0/" /etc/rc.local
echo "Adding rule: $line"
fi

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"