From 5aac8bca84744bbee9b65260836dd5ba3f386ae2 Mon Sep 17 00:00:00 2001 From: Orazio Date: Sat, 5 Dec 2020 11:35:56 +0100 Subject: [PATCH 1/3] Changed WireGuard unit path to /lib/systemd/system/wg-quick@.service - On Raspbian, /lib is not a symbolic link to /usr/lib, so the WireGuard unit won't be found. Therefore changed to /lib/... (which is the default location for units of installed packages). --- auto_install/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 2649b18..8aee5c8 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -2007,7 +2007,7 @@ confOVPN(){ confWireGuard(){ # Reload job type is not yet available in wireguard-tools shipped with Ubuntu 20.04 - if ! grep -q 'ExecReload' /usr/lib/systemd/system/wg-quick@.service; then + if ! grep -q 'ExecReload' /lib/systemd/system/wg-quick@.service; then echo "::: Adding additional reload job type for wg-quick unit" $SUDO install -D -m 644 "${pivpnFilesDir}"/files/etc/systemd/system/wg-quick@.service.d/override.conf /etc/systemd/system/wg-quick@.service.d/override.conf $SUDO systemctl daemon-reload From 308affe4e9aa69c66260026a00029c5f78c7d4e9 Mon Sep 17 00:00:00 2001 From: Orazio Date: Sat, 5 Dec 2020 12:24:22 +0100 Subject: [PATCH 2/3] Workaround for the following error on Ubuntu 20.04: - /usr/bin/debconf-apt-progress: can't open /tmp/tmp.0CoNypDEPj: Permission denied at /usr/bin/debconf-apt-progress line 249, line 3. Reason: https://askubuntu.com/questions/1250974/user-root-cant-write-to-file-in-tmp-owned-by-someone-else-in-20-04-but-can-in --- auto_install/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 8aee5c8..8b97991 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -546,7 +546,7 @@ installDependentPackages(){ fi done - local APTLOGFILE="$(mktemp)" + local APTLOGFILE="$($SUDO mktemp)" if command -v debconf-apt-progress > /dev/null; then # shellcheck disable=SC2086 From dc744a9810d22b845c7ddac634cec7acdb95ca33 Mon Sep 17 00:00:00 2001 From: Orazio Date: Sat, 5 Dec 2020 12:28:14 +0100 Subject: [PATCH 3/3] Fix directory and symbolic link creation when reconfiguring (writing over the same files) --- auto_install/install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 8b97991..f2281f4 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -215,7 +215,7 @@ main(){ # Save installation setting to the final location echo "INSTALLED_PACKAGES=(${INSTALLED_PACKAGES[*]})" >> ${tempsetupVarsFile} echo "::: Setupfiles copied to ${setupConfigDir}/${VPN}/${setupVarsFile}" - $SUDO mkdir "${setupConfigDir}/${VPN}/" + $SUDO mkdir -p "${setupConfigDir}/${VPN}/" $SUDO cp ${tempsetupVarsFile} "${setupConfigDir}/${VPN}/${setupVarsFile}" installScripts @@ -2288,13 +2288,13 @@ installScripts(){ # Unlink the protocol specific pivpn script and symlink the common # script to the location instead $SUDO unlink /usr/local/bin/pivpn - $SUDO ln -s -T "${pivpnFilesDir}/scripts/pivpn" /usr/local/bin/pivpn + $SUDO ln -sf -T "${pivpnFilesDir}/scripts/pivpn" /usr/local/bin/pivpn else # Only one protocol is installed, symlink bash completion, the pivpn script # and the script directory - $SUDO ln -s -T "${pivpnFilesDir}/scripts/${VPN}/bash-completion" /etc/bash_completion.d/pivpn - $SUDO ln -s -T "${pivpnFilesDir}/scripts/${VPN}/pivpn.sh" /usr/local/bin/pivpn - $SUDO ln -s "${pivpnFilesDir}/scripts/" "${pivpnScriptDir}" + $SUDO ln -sf -T "${pivpnFilesDir}/scripts/${VPN}/bash-completion" /etc/bash_completion.d/pivpn + $SUDO ln -sf -T "${pivpnFilesDir}/scripts/${VPN}/pivpn.sh" /usr/local/bin/pivpn + $SUDO ln -sf "${pivpnFilesDir}/scripts/" "${pivpnScriptDir}" # shellcheck disable=SC1091 . /etc/bash_completion.d/pivpn fi