Update the unisntall script, OK.

This commit is contained in:
Stephen KINGER 2016-09-27 14:31:41 +02:00
parent a7c9a35352
commit e541fd39ac
2 changed files with 10 additions and 9 deletions

View file

@ -476,13 +476,11 @@ update_repo() {
}
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+=("udp" "available" "ON")
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)
echo "${chooseProtoCmd[@]}" "${protoArray[@]}"
chooseProtoOptions=$("${chooseProtoCmd[@]}" "${protoArray[@]}" 2>&1 >/dev/tty)
@ -763,6 +761,7 @@ confOpenVPN() {
$SUDO sed -i "s/1194/${PORT}/g" /etc/openvpn/server.conf
fi
# if they modified protocol put value in server.conf
if [ $PROTO != "udp" ]; then
$SUDO sed -i "s/proto udp/proto tcp/g" /etc/openvpn/server.conf
fi
@ -886,6 +885,7 @@ confOVPN() {
$SUDO sed -i -e "s/1194/${PORT}/g" /etc/openvpn/easy-rsa/keys/Default.txt
fi
# if they modified protocol put value in Default.txt for clients to use
if [ $PROTO != "udp" ]; then
$SUDO sed -i -e "s/proto udp/proto tcp/g" /etc/openvpn/easy-rsa/keys/Default.txt
fi

View file

@ -20,6 +20,7 @@ INSTALL_USER=$(cat /etc/pivpn/INSTALL_USER)
PLAT=$(cat /etc/pivpn/DET_PLATFORM)
NO_UFW=$(cat /etc/pivpn/NO_UFW)
PORT=$(cat /etc/pivpn/INSTALL_PORT)
PROTO=$(cat /etc/pivpn/INSTALL_PROTO)
# Find the rows and columns
rows=$(tput lines)
@ -105,7 +106,7 @@ echo ":::"
$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 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
fi