mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-18 19:00:15 +00:00
initial dual install try
This commit is contained in:
parent
e66e2c6513
commit
f379ca2e10
9 changed files with 95 additions and 79 deletions
|
@ -12,7 +12,9 @@
|
||||||
|
|
||||||
######## VARIABLES #########
|
######## VARIABLES #########
|
||||||
pivpnGitUrl="https://github.com/pivpn/pivpn.git"
|
pivpnGitUrl="https://github.com/pivpn/pivpn.git"
|
||||||
setupVars="/etc/pivpn/setupVars.conf"
|
setupVarsFile="setupVars.conf"
|
||||||
|
setupConfigDir="/etc/pivpn" # will be /etc/pivpn/${VPN}/setupVars.conf
|
||||||
|
tempsetupVarsFile="/tmp/setupVars.conf"
|
||||||
pivpnFilesDir="/etc/.pivpn"
|
pivpnFilesDir="/etc/.pivpn"
|
||||||
|
|
||||||
piholeSetupVars="/etc/pihole/setupVars.conf"
|
piholeSetupVars="/etc/pihole/setupVars.conf"
|
||||||
|
@ -118,7 +120,14 @@ main(){
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -r "$setupVars" ]; then
|
# see which setup already exists
|
||||||
|
if [ -r "${setupVarsDir}/wireguard/${setupVarsFile}" ]; then
|
||||||
|
setupVars="${setupVarsDir}/wireguard/${setupVarsFile}"
|
||||||
|
elif [ -f "${setupVarsDir}/openvpn/${setupVarsFile}" ]; then
|
||||||
|
setupVars="${setupVarsDir}/openvpn/${setupVarsFile}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -r "$setupVars" ]; then #qqq
|
||||||
if [[ "${reconfigure}" == true ]]; then
|
if [[ "${reconfigure}" == true ]]; then
|
||||||
echo "::: --reconfigure passed to install script, will reinstall PiVPN overwriting existing settings"
|
echo "::: --reconfigure passed to install script, will reinstall PiVPN overwriting existing settings"
|
||||||
UpdateCmd="Reconfigure"
|
UpdateCmd="Reconfigure"
|
||||||
|
@ -137,7 +146,7 @@ main(){
|
||||||
exit 0
|
exit 0
|
||||||
elif [ "$UpdateCmd" = "Repair" ]; then
|
elif [ "$UpdateCmd" = "Repair" ]; then
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
source "$setupVars"
|
source "$setupVars" #qqq
|
||||||
runUnattended=true
|
runUnattended=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -203,8 +212,9 @@ main(){
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Save installation setting to the final location
|
# Save installation setting to the final location
|
||||||
echo "INSTALLED_PACKAGES=(${INSTALLED_PACKAGES[*]})" >> /tmp/setupVars.conf
|
echo "INSTALLED_PACKAGES=(${INSTALLED_PACKAGES[*]})" >> ${tempsetupVarsFile}
|
||||||
$SUDO cp /tmp/setupVars.conf "$setupVars"
|
echo "::: Setupfiles copied to ${setupConfigDir}/{$VPN}/${setupVarsFile}"
|
||||||
|
$SUDO cp ${tempsetupVarsFile} "${setupConfigDir}/${VPN}/${setupVarsFile}"
|
||||||
|
|
||||||
installScripts
|
installScripts
|
||||||
|
|
||||||
|
@ -287,8 +297,8 @@ distroCheck(){
|
||||||
BASE_DEPS+=(dhcpcd5)
|
BASE_DEPS+=(dhcpcd5)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "PLAT=${PLAT}" > /tmp/setupVars.conf
|
echo "PLAT=${PLAT}" > ${tempsetupVarsFile}
|
||||||
echo "OSCN=${OSCN}" >> /tmp/setupVars.conf
|
echo "OSCN=${OSCN}" >> ${tempsetupVarsFile}
|
||||||
}
|
}
|
||||||
|
|
||||||
noOSSupport(){
|
noOSSupport(){
|
||||||
|
@ -470,7 +480,7 @@ preconfigurePackages(){
|
||||||
echo iptables-persistent iptables-persistent/autosave_v6 boolean false | $SUDO debconf-set-selections
|
echo iptables-persistent iptables-persistent/autosave_v6 boolean false | $SUDO debconf-set-selections
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "USING_UFW=${USING_UFW}" >> /tmp/setupVars.conf
|
echo "USING_UFW=${USING_UFW}" >> ${tempsetupVarsFile}
|
||||||
}
|
}
|
||||||
|
|
||||||
installDependentPackages(){
|
installDependentPackages(){
|
||||||
|
@ -581,12 +591,12 @@ if [ "${runUnattended}" = 'true' ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "IPv4dev=${IPv4dev}" >> /tmp/setupVars.conf
|
echo "IPv4dev=${IPv4dev}" >> ${tempsetupVarsFile}
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
if [ "$interfaceCount" -eq 1 ]; then
|
if [ "$interfaceCount" -eq 1 ]; then
|
||||||
IPv4dev="${availableInterfaces}"
|
IPv4dev="${availableInterfaces}"
|
||||||
echo "IPv4dev=${IPv4dev}" >> /tmp/setupVars.conf
|
echo "IPv4dev=${IPv4dev}" >> ${tempsetupVarsFile}
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -596,7 +606,7 @@ if chooseInterfaceOptions=$("${chooseInterfaceCmd[@]}" "${interfacesArray[@]}" 2
|
||||||
for desiredInterface in ${chooseInterfaceOptions}; do
|
for desiredInterface in ${chooseInterfaceOptions}; do
|
||||||
IPv4dev=${desiredInterface}
|
IPv4dev=${desiredInterface}
|
||||||
echo "::: Using interface: $IPv4dev"
|
echo "::: Using interface: $IPv4dev"
|
||||||
echo "IPv4dev=${IPv4dev}" >> /tmp/setupVars.conf
|
echo "IPv4dev=${IPv4dev}" >> ${tempsetupVarsFile}
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
echo "::: Cancel selected, exiting...."
|
echo "::: Cancel selected, exiting...."
|
||||||
|
@ -711,9 +721,9 @@ getStaticIPv4Settings() {
|
||||||
echo "::: Skipping setting static IP address"
|
echo "::: Skipping setting static IP address"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "dhcpReserv=${dhcpReserv}" >> /tmp/setupVars.conf
|
echo "dhcpReserv=${dhcpReserv}" >> ${tempsetupVarsFile}
|
||||||
echo "IPv4addr=${IPv4addr}" >> /tmp/setupVars.conf
|
echo "IPv4addr=${IPv4addr}" >> ${tempsetupVarsFile}
|
||||||
echo "IPv4gw=${IPv4gw}" >> /tmp/setupVars.conf
|
echo "IPv4gw=${IPv4gw}" >> ${tempsetupVarsFile}
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -735,10 +745,10 @@ No: Setup static IP address
|
||||||
Don't know what DHCP Reservation is? Answer No." ${r} ${c}); then
|
Don't know what DHCP Reservation is? Answer No." ${r} ${c}); then
|
||||||
dhcpReserv=1
|
dhcpReserv=1
|
||||||
# shellcheck disable=SC2129
|
# shellcheck disable=SC2129
|
||||||
echo "dhcpReserv=${dhcpReserv}" >> /tmp/setupVars.conf
|
echo "dhcpReserv=${dhcpReserv}" >> ${tempsetupVarsFile}
|
||||||
# We don't really need to save them as we won't set a static IP but they might be useful for debugging
|
# We don't really need to save them as we won't set a static IP but they might be useful for debugging
|
||||||
echo "IPv4addr=${CurrentIPv4addr}" >> /tmp/setupVars.conf
|
echo "IPv4addr=${CurrentIPv4addr}" >> ${tempsetupVarsFile}
|
||||||
echo "IPv4gw=${CurrentIPv4gw}" >> /tmp/setupVars.conf
|
echo "IPv4gw=${CurrentIPv4gw}" >> ${tempsetupVarsFile}
|
||||||
else
|
else
|
||||||
# Ask if the user wants to use DHCP settings as their static IP
|
# Ask if the user wants to use DHCP settings as their static IP
|
||||||
if (whiptail --backtitle "Calibrating network interface" --title "Static IP Address" --yesno "Do you want to use your current network settings as a static address?
|
if (whiptail --backtitle "Calibrating network interface" --title "Static IP Address" --yesno "Do you want to use your current network settings as a static address?
|
||||||
|
@ -747,8 +757,8 @@ Don't know what DHCP Reservation is? Answer No." ${r} ${c}); then
|
||||||
Gateway: ${CurrentIPv4gw}" ${r} ${c}); then
|
Gateway: ${CurrentIPv4gw}" ${r} ${c}); then
|
||||||
IPv4addr=${CurrentIPv4addr}
|
IPv4addr=${CurrentIPv4addr}
|
||||||
IPv4gw=${CurrentIPv4gw}
|
IPv4gw=${CurrentIPv4gw}
|
||||||
echo "IPv4addr=${IPv4addr}" >> /tmp/setupVars.conf
|
echo "IPv4addr=${IPv4addr}" >> ${tempsetupVarsFile}
|
||||||
echo "IPv4gw=${IPv4gw}" >> /tmp/setupVars.conf
|
echo "IPv4gw=${IPv4gw}" >> ${tempsetupVarsFile}
|
||||||
|
|
||||||
# If they choose yes, let the user know that the IP address will not be available via DHCP and may cause a conflict.
|
# If they choose yes, let the user know that the IP address will not be available via DHCP and may cause a conflict.
|
||||||
whiptail --msgbox --backtitle "IP information" --title "FYI: IP Conflict" "It is possible your router could still try to assign this IP to a device, which would cause a conflict. But in most cases the router is smart enough to not do that.
|
whiptail --msgbox --backtitle "IP information" --title "FYI: IP Conflict" "It is possible your router could still try to assign this IP to a device, which would cause a conflict. But in most cases the router is smart enough to not do that.
|
||||||
|
@ -803,8 +813,8 @@ It is also possible to use a DHCP reservation, but if you are going to do that,
|
||||||
IP address: ${IPv4addr}
|
IP address: ${IPv4addr}
|
||||||
Gateway: ${IPv4gw}" ${r} ${c}); then
|
Gateway: ${IPv4gw}" ${r} ${c}); then
|
||||||
# If the settings are correct, then we need to set the pivpnIP
|
# If the settings are correct, then we need to set the pivpnIP
|
||||||
echo "IPv4addr=${IPv4addr}" >> /tmp/setupVars.conf
|
echo "IPv4addr=${IPv4addr}" >> ${tempsetupVarsFile}
|
||||||
echo "IPv4gw=${IPv4gw}" >> /tmp/setupVars.conf
|
echo "IPv4gw=${IPv4gw}" >> ${tempsetupVarsFile}
|
||||||
# After that's done, the loop ends and we move on
|
# After that's done, the loop ends and we move on
|
||||||
ipSettingsCorrect=True
|
ipSettingsCorrect=True
|
||||||
else
|
else
|
||||||
|
@ -867,8 +877,8 @@ chooseUser(){
|
||||||
fi
|
fi
|
||||||
install_home=$(grep -m1 "^${install_user}:" /etc/passwd | cut -d: -f6)
|
install_home=$(grep -m1 "^${install_user}:" /etc/passwd | cut -d: -f6)
|
||||||
install_home=${install_home%/}
|
install_home=${install_home%/}
|
||||||
echo "install_user=${install_user}" >> /tmp/setupVars.conf
|
echo "install_user=${install_user}" >> ${tempsetupVarsFile}
|
||||||
echo "install_home=${install_home}" >> /tmp/setupVars.conf
|
echo "install_home=${install_home}" >> ${tempsetupVarsFile}
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -915,8 +925,8 @@ chooseUser(){
|
||||||
echo "::: Using User: $install_user"
|
echo "::: Using User: $install_user"
|
||||||
install_home=$(grep -m1 "^${install_user}:" /etc/passwd | cut -d: -f6)
|
install_home=$(grep -m1 "^${install_user}:" /etc/passwd | cut -d: -f6)
|
||||||
install_home=${install_home%/} # remove possible trailing slash
|
install_home=${install_home%/} # remove possible trailing slash
|
||||||
echo "install_user=${install_user}" >> /tmp/setupVars.conf
|
echo "install_user=${install_user}" >> ${tempsetupVarsFile}
|
||||||
echo "install_home=${install_home}" >> /tmp/setupVars.conf
|
echo "install_home=${install_home}" >> ${tempsetupVarsFile}
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
echo "::: Cancel selected, exiting...."
|
echo "::: Cancel selected, exiting...."
|
||||||
|
@ -1034,13 +1044,13 @@ installPiVPN(){
|
||||||
confWireGuard
|
confWireGuard
|
||||||
confNetwork
|
confNetwork
|
||||||
|
|
||||||
echo "pivpnPROTO=${pivpnPROTO}" >> /tmp/setupVars.conf
|
echo "pivpnPROTO=${pivpnPROTO}" >> ${tempsetupVarsFile}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "pivpnDEV=${pivpnDEV}" >> /tmp/setupVars.conf
|
echo "pivpnDEV=${pivpnDEV}" >> ${tempsetupVarsFile}
|
||||||
echo "pivpnNET=${pivpnNET}" >> /tmp/setupVars.conf
|
echo "pivpnNET=${pivpnNET}" >> ${tempsetupVarsFile}
|
||||||
echo "subnetClass=${subnetClass}" >> /tmp/setupVars.conf
|
echo "subnetClass=${subnetClass}" >> ${tempsetupVarsFile}
|
||||||
}
|
}
|
||||||
|
|
||||||
askWhichVPN(){
|
askWhichVPN(){
|
||||||
|
@ -1093,7 +1103,7 @@ askWhichVPN(){
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "VPN=${VPN}" >> /tmp/setupVars.conf
|
echo "VPN=${VPN}" >> ${tempsetupVarsFile}
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadVerifyKey(){
|
downloadVerifyKey(){
|
||||||
|
@ -1295,7 +1305,7 @@ askCustomProto(){
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "pivpnPROTO=${pivpnPROTO}" >> /tmp/setupVars.conf
|
echo "pivpnPROTO=${pivpnPROTO}" >> ${tempsetupVarsFile}
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1308,7 +1318,7 @@ askCustomProto(){
|
||||||
# Convert option into lowercase (UDP->udp)
|
# Convert option into lowercase (UDP->udp)
|
||||||
pivpnPROTO="${pivpnPROTO,,}"
|
pivpnPROTO="${pivpnPROTO,,}"
|
||||||
echo "::: Using protocol: $pivpnPROTO"
|
echo "::: Using protocol: $pivpnPROTO"
|
||||||
echo "pivpnPROTO=${pivpnPROTO}" >> /tmp/setupVars.conf
|
echo "pivpnPROTO=${pivpnPROTO}" >> ${tempsetupVarsFile}
|
||||||
else
|
else
|
||||||
echo "::: Cancel selected, exiting...."
|
echo "::: Cancel selected, exiting...."
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -1338,7 +1348,7 @@ askCustomPort(){
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "pivpnPORT=${pivpnPORT}" >> /tmp/setupVars.conf
|
echo "pivpnPORT=${pivpnPORT}" >> ${tempsetupVarsFile}
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1381,7 +1391,7 @@ askCustomPort(){
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
# write out the port
|
# write out the port
|
||||||
echo "pivpnPORT=${pivpnPORT}" >> /tmp/setupVars.conf
|
echo "pivpnPORT=${pivpnPORT}" >> ${tempsetupVarsFile}
|
||||||
}
|
}
|
||||||
|
|
||||||
askClientDNS(){
|
askClientDNS(){
|
||||||
|
@ -1414,8 +1424,8 @@ askClientDNS(){
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "pivpnDNS1=${pivpnDNS1}" >> /tmp/setupVars.conf
|
echo "pivpnDNS1=${pivpnDNS1}" >> ${tempsetupVarsFile}
|
||||||
echo "pivpnDNS2=${pivpnDNS2}" >> /tmp/setupVars.conf
|
echo "pivpnDNS2=${pivpnDNS2}" >> ${tempsetupVarsFile}
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1450,8 +1460,8 @@ askClientDNS(){
|
||||||
# Use the Raspberry Pi VPN IP as DNS server.
|
# Use the Raspberry Pi VPN IP as DNS server.
|
||||||
pivpnDNS1="$vpnGw"
|
pivpnDNS1="$vpnGw"
|
||||||
|
|
||||||
echo "pivpnDNS1=${pivpnDNS1}" >> /tmp/setupVars.conf
|
echo "pivpnDNS1=${pivpnDNS1}" >> ${tempsetupVarsFile}
|
||||||
echo "pivpnDNS2=${pivpnDNS2}" >> /tmp/setupVars.conf
|
echo "pivpnDNS2=${pivpnDNS2}" >> ${tempsetupVarsFile}
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -1536,8 +1546,8 @@ askClientDNS(){
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "pivpnDNS1=${pivpnDNS1}" >> /tmp/setupVars.conf
|
echo "pivpnDNS1=${pivpnDNS1}" >> ${tempsetupVarsFile}
|
||||||
echo "pivpnDNS2=${pivpnDNS2}" >> /tmp/setupVars.conf
|
echo "pivpnDNS2=${pivpnDNS2}" >> ${tempsetupVarsFile}
|
||||||
}
|
}
|
||||||
|
|
||||||
#Call this function to use a regex to check user input for a valid custom domain
|
#Call this function to use a regex to check user input for a valid custom domain
|
||||||
|
@ -1564,7 +1574,7 @@ askCustomDomain(){
|
||||||
else
|
else
|
||||||
echo "::: Skipping custom domain"
|
echo "::: Skipping custom domain"
|
||||||
fi
|
fi
|
||||||
echo "pivpnSEARCHDOMAIN=${pivpnSEARCHDOMAIN}" >> /tmp/setupVars.conf
|
echo "pivpnSEARCHDOMAIN=${pivpnSEARCHDOMAIN}" >> ${tempsetupVarsFile}
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1593,7 +1603,7 @@ askCustomDomain(){
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "pivpnSEARCHDOMAIN=${pivpnSEARCHDOMAIN}" >> /tmp/setupVars.conf
|
echo "pivpnSEARCHDOMAIN=${pivpnSEARCHDOMAIN}" >> ${tempsetupVarsFile}
|
||||||
}
|
}
|
||||||
|
|
||||||
askPublicIPOrDNS(){
|
askPublicIPOrDNS(){
|
||||||
|
@ -1619,7 +1629,7 @@ askPublicIPOrDNS(){
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "pivpnHOST=${pivpnHOST}" >> /tmp/setupVars.conf
|
echo "pivpnHOST=${pivpnHOST}" >> ${tempsetupVarsFile}
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1663,7 +1673,7 @@ askPublicIPOrDNS(){
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "pivpnHOST=${pivpnHOST}" >> /tmp/setupVars.conf
|
echo "pivpnHOST=${pivpnHOST}" >> ${tempsetupVarsFile}
|
||||||
}
|
}
|
||||||
|
|
||||||
askEncryption(){
|
askEncryption(){
|
||||||
|
@ -1712,9 +1722,9 @@ askEncryption(){
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "TWO_POINT_FOUR=${TWO_POINT_FOUR}" >> /tmp/setupVars.conf
|
echo "TWO_POINT_FOUR=${TWO_POINT_FOUR}" >> ${tempsetupVarsFile}
|
||||||
echo "pivpnENCRYPT=${pivpnENCRYPT}" >> /tmp/setupVars.conf
|
echo "pivpnENCRYPT=${pivpnENCRYPT}" >> ${tempsetupVarsFile}
|
||||||
echo "USE_PREDEFINED_DH_PARAM=${USE_PREDEFINED_DH_PARAM}" >> /tmp/setupVars.conf
|
echo "USE_PREDEFINED_DH_PARAM=${USE_PREDEFINED_DH_PARAM}" >> ${tempsetupVarsFile}
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1746,9 +1756,9 @@ askEncryption(){
|
||||||
USE_PREDEFINED_DH_PARAM=0
|
USE_PREDEFINED_DH_PARAM=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "TWO_POINT_FOUR=${TWO_POINT_FOUR}" >> /tmp/setupVars.conf
|
echo "TWO_POINT_FOUR=${TWO_POINT_FOUR}" >> ${tempsetupVarsFile}
|
||||||
echo "pivpnENCRYPT=${pivpnENCRYPT}" >> /tmp/setupVars.conf
|
echo "pivpnENCRYPT=${pivpnENCRYPT}" >> ${tempsetupVarsFile}
|
||||||
echo "USE_PREDEFINED_DH_PARAM=${USE_PREDEFINED_DH_PARAM}" >> /tmp/setupVars.conf
|
echo "USE_PREDEFINED_DH_PARAM=${USE_PREDEFINED_DH_PARAM}" >> ${tempsetupVarsFile}
|
||||||
}
|
}
|
||||||
|
|
||||||
cidrToMask(){
|
cidrToMask(){
|
||||||
|
@ -2092,8 +2102,8 @@ confNetwork(){
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "INPUT_CHAIN_EDITED=${INPUT_CHAIN_EDITED}" >> /tmp/setupVars.conf
|
echo "INPUT_CHAIN_EDITED=${INPUT_CHAIN_EDITED}" >> ${tempsetupVarsFile}
|
||||||
echo "FORWARD_CHAIN_EDITED=${FORWARD_CHAIN_EDITED}" >> /tmp/setupVars.conf
|
echo "FORWARD_CHAIN_EDITED=${FORWARD_CHAIN_EDITED}" >> ${tempsetupVarsFile}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -2156,7 +2166,7 @@ askUnattendedUpgrades(){
|
||||||
echo "::: Skipping unattended upgrades"
|
echo "::: Skipping unattended upgrades"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "UNATTUPG=${UNATTUPG}" >> /tmp/setupVars.conf
|
echo "UNATTUPG=${UNATTUPG}" >> ${tempsetupVarsFile}
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -2168,7 +2178,7 @@ askUnattendedUpgrades(){
|
||||||
UNATTUPG=0
|
UNATTUPG=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "UNATTUPG=${UNATTUPG}" >> /tmp/setupVars.conf
|
echo "UNATTUPG=${UNATTUPG}" >> ${tempsetupVarsFile}
|
||||||
}
|
}
|
||||||
|
|
||||||
confUnattendedUpgrades(){
|
confUnattendedUpgrades(){
|
||||||
|
@ -2230,8 +2240,8 @@ installScripts(){
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$SUDO install -m 755 "$pivpnFilesDir"/scripts/*.sh -t /opt/pivpn
|
$SUDO install -m 755 "$pivpnFilesDir"/scripts/*.sh -t /opt/pivpn
|
||||||
$SUDO install -m 755 "$pivpnFilesDir"/scripts/"$VPN"/*.sh -t /opt/pivpn
|
$SUDO install -m 755 "$pivpnFilesDir"/scripts/"$VPN"/*.sh -t /opt/pivpn/${VPN}
|
||||||
$SUDO install -m 755 "$pivpnFilesDir"/scripts/"$VPN"/pivpn /usr/local/bin/pivpn
|
$SUDO install -m 755 "$pivpnFilesDir"/scripts/"$VPN"/pivpn /usr/local/bin/pivpn/${VPN}
|
||||||
$SUDO install -m 644 "$pivpnFilesDir"/scripts/"$VPN"/bash-completion /etc/bash_completion.d/pivpn
|
$SUDO install -m 644 "$pivpnFilesDir"/scripts/"$VPN"/bash-completion /etc/bash_completion.d/pivpn
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
. /etc/bash_completion.d/pivpn
|
. /etc/bash_completion.d/pivpn
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Create OVPN Client
|
# Create OVPN Client
|
||||||
# Default Variable Declarations
|
# Default Variable Declarations
|
||||||
setupVars="/etc/pivpn/setupVars.conf"
|
setupVars="/etc/pivpn/openvpn/setupVars.conf"
|
||||||
DEFAULT="Default.txt"
|
DEFAULT="Default.txt"
|
||||||
FILEEXT=".ovpn"
|
FILEEXT=".ovpn"
|
||||||
CRT=".crt"
|
CRT=".crt"
|
||||||
|
|
|
@ -10,26 +10,29 @@ if [[ ! $EUID -eq 0 ]];then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
scriptdir="/opt/pivpn"
|
||||||
|
vpn="openvpn"
|
||||||
|
|
||||||
function makeOVPNFunc {
|
function makeOVPNFunc {
|
||||||
shift
|
shift
|
||||||
$SUDO /opt/pivpn/makeOVPN.sh "$@"
|
$SUDO ${scripdir}/${vpn}/makeOVPN.sh "$@"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function listClientsFunc {
|
function listClientsFunc {
|
||||||
shift
|
shift
|
||||||
$SUDO /opt/pivpn/clientStat.sh "$@"
|
$SUDO ${scripdir}/${vpn}/clientStat.sh "$@"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function listOVPNFunc {
|
function listOVPNFunc {
|
||||||
$SUDO /opt/pivpn/listOVPN.sh
|
$SUDO ${scripdir}/${vpn}/listOVPN.sh
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function debugFunc {
|
function debugFunc {
|
||||||
echo "::: Generating Debug Output"
|
echo "::: Generating Debug Output"
|
||||||
$SUDO /opt/pivpn/pivpnDebug.sh | tee /tmp/debug.txt
|
$SUDO ${scripdir}/${vpn}/pivpnDebug.sh | tee /tmp/debug.txt
|
||||||
echo "::: "
|
echo "::: "
|
||||||
echo "::: Debug output completed above."
|
echo "::: Debug output completed above."
|
||||||
echo "::: Copy saved to /tmp/debug.txt"
|
echo "::: Copy saved to /tmp/debug.txt"
|
||||||
|
@ -39,12 +42,12 @@ function debugFunc {
|
||||||
|
|
||||||
function removeOVPNFunc {
|
function removeOVPNFunc {
|
||||||
shift
|
shift
|
||||||
$SUDO /opt/pivpn/removeOVPN.sh "$@"
|
$SUDO ${scripdir}/${vpn}/removeOVPN.sh "$@"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function uninstallFunc {
|
function uninstallFunc {
|
||||||
$SUDO /opt/pivpn/uninstall.sh
|
$SUDO ${scripdir}/uninstall.sh
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +58,7 @@ function versionFunc {
|
||||||
function update {
|
function update {
|
||||||
|
|
||||||
shift
|
shift
|
||||||
$SUDO /opt/pivpn/update.sh "$@"
|
$SUDO ${scripdir}/update.sh "$@"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,7 +66,7 @@ function update {
|
||||||
|
|
||||||
function backup {
|
function backup {
|
||||||
|
|
||||||
$SUDO /opt/pivpn/backup.sh
|
$SUDO ${scripdir}/backup.sh
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# This scripts runs as root
|
# This scripts runs as root
|
||||||
|
|
||||||
setupVars="/etc/pivpn/setupVars.conf"
|
setupVars="/etc/pivpn/openvpn/setupVars.conf"
|
||||||
|
|
||||||
if [ ! -f "${setupVars}" ]; then
|
if [ ! -f "${setupVars}" ]; then
|
||||||
echo "::: Missing setup vars file!"
|
echo "::: Missing setup vars file!"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# PiVPN: revoke client script
|
# PiVPN: revoke client script
|
||||||
|
|
||||||
setupVars="/etc/pivpn/setupVars.conf"
|
setupVars="/etc/pivpn/openvpn/setupVars.conf"
|
||||||
INDEX="/etc/openvpn/easy-rsa/pki/index.txt"
|
INDEX="/etc/openvpn/easy-rsa/pki/index.txt"
|
||||||
|
|
||||||
if [ ! -f "${setupVars}" ]; then
|
if [ ! -f "${setupVars}" ]; then
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
setupVars="/etc/pivpn/setupVars.conf"
|
setupVars="/etc/pivpn/wireguard/setupVars.conf"
|
||||||
|
|
||||||
if [ ! -f "${setupVars}" ]; then
|
if [ ! -f "${setupVars}" ]; then
|
||||||
echo "::: Missing setup vars file!"
|
echo "::: Missing setup vars file!"
|
||||||
|
|
|
@ -10,53 +10,56 @@ if [ $EUID -ne 0 ];then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
scriptdir="/opt/pivpn"
|
||||||
|
vpn="wireguard"
|
||||||
|
|
||||||
makeConf(){
|
makeConf(){
|
||||||
shift
|
shift
|
||||||
$SUDO /opt/pivpn/makeCONF.sh "$@"
|
$SUDO ${scriptdir}/${vpn}/makeCONF.sh "$@"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
listConnected(){
|
listConnected(){
|
||||||
shift
|
shift
|
||||||
$SUDO /opt/pivpn/clientSTAT.sh "$@"
|
$SUDO ${scriptdir}/${vpn}/clientSTAT.sh "$@"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
debug(){
|
debug(){
|
||||||
$SUDO /opt/pivpn/pivpnDEBUG.sh
|
$SUDO ${scriptdir}/${vpn}/pivpnDEBUG.sh
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
listClients(){
|
listClients(){
|
||||||
$SUDO /opt/pivpn/listCONF.sh
|
$SUDO ${scriptdir}/${vpn}/listCONF.sh
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
showQrcode(){
|
showQrcode(){
|
||||||
shift
|
shift
|
||||||
$SUDO /opt/pivpn/qrcodeCONF.sh "$@"
|
$SUDO ${scriptdir}/${vpn}/qrcodeCONF.sh "$@"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
removeClient(){
|
removeClient(){
|
||||||
shift
|
shift
|
||||||
$SUDO /opt/pivpn/removeCONF.sh "$@"
|
$SUDO ${scriptdir}/${vpn}/removeCONF.sh "$@"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
uninstallServer(){
|
uninstallServer(){
|
||||||
$SUDO /opt/pivpn/uninstall.sh
|
$SUDO ${scriptdir}/uninstall.sh
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
updateScripts(){
|
updateScripts(){
|
||||||
shift
|
shift
|
||||||
$SUDO /opt/pivpn/update.sh "$@"
|
$SUDO ${scriptdir}/update.sh "$@"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
backup(){
|
backup(){
|
||||||
$SUDO /opt/pivpn/backup.sh
|
$SUDO ${scriptdir}/backup.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
showHelp(){
|
showHelp(){
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# This scripts runs as root
|
# This scripts runs as root
|
||||||
|
|
||||||
setupVars="/etc/pivpn/setupVars.conf"
|
setupVars="/etc/pivpn/wireguard/setupVars.conf"
|
||||||
|
|
||||||
if [ ! -f "${setupVars}" ]; then
|
if [ ! -f "${setupVars}" ]; then
|
||||||
echo "::: Missing setup vars file!"
|
echo "::: Missing setup vars file!"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
setupVars="/etc/pivpn/setupVars.conf"
|
setupVars="/etc/pivpn/wireguard/setupVars.conf"
|
||||||
|
|
||||||
if [ ! -f "${setupVars}" ]; then
|
if [ ! -f "${setupVars}" ]; then
|
||||||
echo "::: Missing setup vars file!"
|
echo "::: Missing setup vars file!"
|
||||||
|
|
Loading…
Reference in a new issue