1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00
raspap-webgui/installers/configauth.sh

16 lines
358 B
Bash
Raw Normal View History

2019-11-15 10:01:57 +01:00
#!/bin/bash
# Updates openvpn client.conf with auth credentials
2019-11-16 10:15:39 +01:00
echo "Enabling auth credentials in OpenVPN client.conf"
2019-11-15 10:01:57 +01:00
line='auth-user-pass'
file='/tmp/ovpnclient.ovpn'
if grep -q "$line" $file; then
2019-11-16 10:15:39 +01:00
echo "Updating $line"
2019-11-15 10:01:57 +01:00
sudo sed -i "s/$line/$line login.conf/g" $file
else
2019-11-16 10:15:39 +01:00
echo "Adding $line"
2019-11-15 10:01:57 +01:00
sudo sed -i "$ a $line login.conf" $file
fi