mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-19 03:10:16 +00:00
Update the unisntall script, not tested yet.
This commit is contained in:
parent
a7c9a35352
commit
f81425e05a
2 changed files with 10 additions and 9 deletions
|
@ -476,13 +476,11 @@ update_repo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
setCustomProto() {
|
setCustomProto() {
|
||||||
# Turn the available interfaces into an array so it can be used with a whiptail dialog
|
# Set the available protocols into an array so it can be used with a whiptail dialog
|
||||||
protoArray=()
|
protoArray=()
|
||||||
|
|
||||||
protoArray+=("udp" "available" "ON")
|
protoArray+=("udp" "available" "ON")
|
||||||
protoArray+=("tcp" "available" "OFF")
|
protoArray+=("tcp" "available" "OFF")
|
||||||
|
|
||||||
# Find out how many interfaces are available to choose from
|
|
||||||
chooseProtoCmd=(whiptail --separate-output --radiolist "Choose A Protocol" $r $c 2)
|
chooseProtoCmd=(whiptail --separate-output --radiolist "Choose A Protocol" $r $c 2)
|
||||||
echo "${chooseProtoCmd[@]}" "${protoArray[@]}"
|
echo "${chooseProtoCmd[@]}" "${protoArray[@]}"
|
||||||
chooseProtoOptions=$("${chooseProtoCmd[@]}" "${protoArray[@]}" 2>&1 >/dev/tty)
|
chooseProtoOptions=$("${chooseProtoCmd[@]}" "${protoArray[@]}" 2>&1 >/dev/tty)
|
||||||
|
@ -763,6 +761,7 @@ confOpenVPN() {
|
||||||
$SUDO sed -i "s/1194/${PORT}/g" /etc/openvpn/server.conf
|
$SUDO sed -i "s/1194/${PORT}/g" /etc/openvpn/server.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# if they modified protocol put value in server.conf
|
||||||
if [ $PROTO != "udp" ]; then
|
if [ $PROTO != "udp" ]; then
|
||||||
$SUDO sed -i "s/proto udp/proto tcp/g" /etc/openvpn/server.conf
|
$SUDO sed -i "s/proto udp/proto tcp/g" /etc/openvpn/server.conf
|
||||||
fi
|
fi
|
||||||
|
@ -886,6 +885,7 @@ confOVPN() {
|
||||||
$SUDO sed -i -e "s/1194/${PORT}/g" /etc/openvpn/easy-rsa/keys/Default.txt
|
$SUDO sed -i -e "s/1194/${PORT}/g" /etc/openvpn/easy-rsa/keys/Default.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# if they modified protocol put value in Default.txt for clients to use
|
||||||
if [ $PROTO != "udp" ]; then
|
if [ $PROTO != "udp" ]; then
|
||||||
$SUDO sed -i -e "s/proto udp/proto tcp/g" /etc/openvpn/easy-rsa/keys/Default.txt
|
$SUDO sed -i -e "s/proto udp/proto tcp/g" /etc/openvpn/easy-rsa/keys/Default.txt
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -20,6 +20,7 @@ INSTALL_USER=$(cat /etc/pivpn/INSTALL_USER)
|
||||||
PLAT=$(cat /etc/pivpn/DET_PLATFORM)
|
PLAT=$(cat /etc/pivpn/DET_PLATFORM)
|
||||||
NO_UFW=$(cat /etc/pivpn/NO_UFW)
|
NO_UFW=$(cat /etc/pivpn/NO_UFW)
|
||||||
PORT=$(cat /etc/pivpn/INSTALL_PORT)
|
PORT=$(cat /etc/pivpn/INSTALL_PORT)
|
||||||
|
PROTO=$(cat /etc/pivpn/INSTALL_PROTO)
|
||||||
|
|
||||||
# Find the rows and columns
|
# Find the rows and columns
|
||||||
rows=$(tput lines)
|
rows=$(tput lines)
|
||||||
|
@ -105,7 +106,7 @@ echo ":::"
|
||||||
$SUDO sed -i "s/\(DEFAULT_FORWARD_POLICY=\).*/\1\"DROP\"/" /etc/default/ufw
|
$SUDO sed -i "s/\(DEFAULT_FORWARD_POLICY=\).*/\1\"DROP\"/" /etc/default/ufw
|
||||||
$SUDO sed -i '/START OPENVPN RULES/,/END OPENVPN RULES/ d' /etc/ufw/before.rules
|
$SUDO sed -i '/START OPENVPN RULES/,/END OPENVPN RULES/ d' /etc/ufw/before.rules
|
||||||
$SUDO ufw delete allow from 10.8.0.0/24 >/dev/null
|
$SUDO ufw delete allow from 10.8.0.0/24 >/dev/null
|
||||||
$SUDO ufw delete allow ${PORT}/udp >/dev/null
|
$SUDO ufw delete allow ${PORT}/${PROTO} >/dev/null
|
||||||
$SUDO ufw reload
|
$SUDO ufw reload
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue