mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Added argument for auth-user-pass
This commit is contained in:
parent
40ac95af59
commit
5eac756946
26
installers/configauth.sh
Normal file → Executable file
26
installers/configauth.sh
Normal file → Executable file
@ -7,23 +7,25 @@
|
||||
# license: GNU General Public License v3.0
|
||||
|
||||
file=$1
|
||||
interface=$2
|
||||
auth=$2
|
||||
interface=$3
|
||||
|
||||
echo "Enabling auth credentials in OpenVPN client.conf"
|
||||
line='auth-user-pass'
|
||||
|
||||
if grep -q "$line" $file; then
|
||||
echo "Updating $line"
|
||||
sudo sed -i "s/$line/$line login.conf/g" $file
|
||||
else
|
||||
echo "Adding $line"
|
||||
sudo sed -i "$ a $line login.conf" $file
|
||||
if [ "$auth" = 1 ]; then
|
||||
echo "Enabling auth-user-pass in OpenVPN client.conf"
|
||||
line='auth-user-pass'
|
||||
if grep -q "$line" $file; then
|
||||
echo "Updating $line"
|
||||
sudo sed -i "s/$line/$line login.conf/g" $file
|
||||
else
|
||||
echo "Adding $line"
|
||||
sudo sed -i "$ a $line login.conf" $file
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Adding iptables rules for $interface"
|
||||
|
||||
# Generate iptables entries to place into rc.local file.
|
||||
# #RASPAP is for uninstall script
|
||||
echo "Adding iptables rules for $interface"
|
||||
|
||||
lines=(
|
||||
"iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE #RASPAP"
|
||||
"iptables -A FORWARD -i tun0 -o $interface -m state --state RELATED,ESTABLISHED -j ACCEPT #RASPAP"
|
||||
|
Loading…
Reference in New Issue
Block a user