From 6099ea34ca51e52cf57bbd931eea8040b760290a Mon Sep 17 00:00:00 2001 From: stevoh6 Date: Mon, 31 Aug 2020 21:24:47 +0200 Subject: [PATCH 1/2] Add Ubuntu 20.04 (Focal Fossa) into supported OS --- auto_install/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 3fc82fb..a2e8b1d 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -269,7 +269,7 @@ distroCheck(){ source /etc/os-release PLAT=$(awk '{print $1}' <<< "$NAME") VER="$VERSION_ID" - declare -A VER_MAP=(["9"]="stretch" ["10"]="buster" ["16.04"]="xenial" ["18.04"]="bionic") + declare -A VER_MAP=(["9"]="stretch" ["10"]="buster" ["16.04"]="xenial" ["18.04"]="bionic" ["20.04"]="focal") OSCN=${VER_MAP["${VER}"]} fi @@ -285,7 +285,7 @@ distroCheck(){ case ${PLAT} in Debian|Raspbian|Ubuntu) case ${OSCN} in - buster|xenial|bionic|stretch) + buster|xenial|bionic|stretch|focal) : ;; *) From d3992b3ff9f55204955e3d38ad1608b98f3bbbf3 Mon Sep 17 00:00:00 2001 From: stevoh6 Date: Thu, 3 Sep 2020 12:39:26 +0200 Subject: [PATCH 2/2] WireGuard on arm with Ubuntu 20.04 Focal Fosa Allow install WireGuard on arm devices with Ubuntu 20.04 Focal Fosa --- auto_install/install.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index a2e8b1d..d739fed 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -16,7 +16,7 @@ pivpnGitUrl="https://github.com/pivpn/pivpn.git" #pivpnGitUrl="/home/pi/repos/pivpn" setupVarsFile="setupVars.conf" -setupConfigDir="/etc/pivpn" +setupConfigDir="/etc/pivpn" tempsetupVarsFile="/tmp/setupVars.conf" pivpnFilesDir="/usr/local/src/pivpn" pivpnScriptDir="/opt/pivpn" @@ -129,9 +129,9 @@ main(){ setupVars="${setupConfigDir}/wireguard/${setupVarsFile}" elif [ -r "${setupConfigDir}/openvpn/${setupVarsFile}" ]; then setupVars="${setupConfigDir}/openvpn/${setupVarsFile}" - fi + fi - if [ -r "$setupVars" ]; then + if [ -r "$setupVars" ]; then if [[ "${reconfigure}" == true ]]; then echo "::: --reconfigure passed to install script, will reinstall PiVPN overwriting existing settings" UpdateCmd="Reconfigure" @@ -150,7 +150,7 @@ main(){ exit 0 elif [ "$UpdateCmd" = "Repair" ]; then # shellcheck disable=SC1090 - source "$setupVars" + source "$setupVars" runUnattended=true fi @@ -219,7 +219,7 @@ main(){ echo "INSTALLED_PACKAGES=(${INSTALLED_PACKAGES[*]})" >> ${tempsetupVarsFile} echo "::: Setupfiles copied to ${setupConfigDir}/${VPN}/${setupVarsFile}" $SUDO mkdir "${setupConfigDir}/${VPN}/" - $SUDO cp ${tempsetupVarsFile} "${setupConfigDir}/${VPN}/${setupVarsFile}" + $SUDO cp ${tempsetupVarsFile} "${setupConfigDir}/${VPN}/${setupVarsFile}" installScripts @@ -1068,7 +1068,8 @@ installPiVPN(){ askWhichVPN(){ if [ "${runUnattended}" = 'true' ]; then - if [ "$PLAT" = "Raspbian" ] || [ "$X86_SYSTEM" -eq 1 ]; then + # [ "$OSCN" = "focal" ] > WireGuard is supported in Ubuntu 20.04 on all architectures + if [ "$PLAT" = "Raspbian" ] || [ "$OSCN" = "focal" ] || [ "$X86_SYSTEM" -eq 1 ]; then if [ -z "$VPN" ]; then echo ":: No VPN protocol specified, using WireGuard" VPN="wireguard" @@ -1098,7 +1099,8 @@ askWhichVPN(){ fi fi else - if [ "$PLAT" = "Raspbian" ] || [ "$X86_SYSTEM" -eq 1 ]; then + # [ "$OSCN" = "focal" ] > WireGuard is supported in Ubuntu 20.04 on all architectures + if [ "$PLAT" = "Raspbian" ] || [ "$OSCN" = "focal" ] || [ "$X86_SYSTEM" -eq 1 ]; then chooseVPNCmd=(whiptail --backtitle "Setup PiVPN" --title "Installation mode" --separate-output --radiolist "WireGuard is a new kind of VPN that provides near-instantaneous connection speed, high performance, and modern cryptography.\\n\\nIt's the recommended choice especially if you use mobile devices where WireGuard is easier on battery than OpenVPN.\\n\\nOpenVPN is still available if you need the traditional, flexible, trusted VPN protocol or if you need features like TCP and custom search domain.\\n\\nChoose a VPN (press space to select):" "${r}" "${c}" 2) VPNChooseOptions=(WireGuard "" on OpenVPN "" off)