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
12
installers/configauth.sh
Normal file → Executable file
12
installers/configauth.sh
Normal file → Executable file
@ -7,11 +7,12 @@
|
|||||||
# license: GNU General Public License v3.0
|
# license: GNU General Public License v3.0
|
||||||
|
|
||||||
file=$1
|
file=$1
|
||||||
interface=$2
|
auth=$2
|
||||||
|
interface=$3
|
||||||
|
|
||||||
echo "Enabling auth credentials in OpenVPN client.conf"
|
if [ "$auth" = 1 ]; then
|
||||||
|
echo "Enabling auth-user-pass in OpenVPN client.conf"
|
||||||
line='auth-user-pass'
|
line='auth-user-pass'
|
||||||
|
|
||||||
if grep -q "$line" $file; then
|
if grep -q "$line" $file; then
|
||||||
echo "Updating $line"
|
echo "Updating $line"
|
||||||
sudo sed -i "s/$line/$line login.conf/g" $file
|
sudo sed -i "s/$line/$line login.conf/g" $file
|
||||||
@ -19,11 +20,12 @@ else
|
|||||||
echo "Adding $line"
|
echo "Adding $line"
|
||||||
sudo sed -i "$ a $line login.conf" $file
|
sudo sed -i "$ a $line login.conf" $file
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
echo "Adding iptables rules for $interface"
|
|
||||||
|
|
||||||
# Generate iptables entries to place into rc.local file.
|
# Generate iptables entries to place into rc.local file.
|
||||||
# #RASPAP is for uninstall script
|
# #RASPAP is for uninstall script
|
||||||
|
echo "Adding iptables rules for $interface"
|
||||||
|
|
||||||
lines=(
|
lines=(
|
||||||
"iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE #RASPAP"
|
"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"
|
"iptables -A FORWARD -i tun0 -o $interface -m state --state RELATED,ESTABLISHED -j ACCEPT #RASPAP"
|
||||||
|
Loading…
Reference in New Issue
Block a user