From b12996df37f2ac82be28a7775a055f02742b9283 Mon Sep 17 00:00:00 2001 From: Orazio Date: Sat, 25 Jan 2020 18:01:07 +0100 Subject: [PATCH] Inform the user when updating the package cache, which can be slow on some RPis --- auto_install/install.sh | 8 ++++++-- scripts/uninstall.sh | 3 +++ scripts/wireguard/clientSTAT.sh | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 8a76550..68e09bd 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -1049,6 +1049,7 @@ installOpenVPN(){ installDependentPackages PIVPN_DEPS[@] wget -qO- https://swupdate.openvpn.net/repos/repo-public.gpg | $SUDO apt-key add - echo "deb https://build.openvpn.net/debian/openvpn/stable $OSCN main" | $SUDO tee /etc/apt/sources.list.d/pivpn-openvpn-repo.list > /dev/null + echo "::: Updating package cache..." # shellcheck disable=SC2086 $SUDO ${UPDATE_PKG_CACHE} &> /dev/null & spinner $! fi @@ -1081,7 +1082,8 @@ installWireGuard(){ printf 'Package: *\nPin: release a=unstable\nPin-Priority: 1\n\nPackage: wireguard wireguard-dkms wireguard-tools\nPin: release a=unstable\nPin-Priority: 500\n' | $SUDO tee /etc/apt/preferences.d/pivpn-limit-unstable > /dev/null $SUDO apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138 - # shellcheck disable=SC2086 + echo "::: Updating package cache..." + # shellcheck disable=SC2086 $SUDO ${UPDATE_PKG_CACHE} &> /dev/null & spinner $! PIVPN_DEPS=(raspberrypi-kernel-headers wireguard wireguard-tools wireguard-dkms) installDependentPackages PIVPN_DEPS[@] @@ -1182,7 +1184,8 @@ installWireGuard(){ echo "::: Adding Debian repository... " echo "deb https://deb.debian.org/debian/ unstable main" | $SUDO tee /etc/apt/sources.list.d/pivpn-unstable.list > /dev/null printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' | $SUDO tee /etc/apt/preferences.d/pivpn-limit-unstable > /dev/null - # shellcheck disable=SC2086 + echo "::: Updating package cache..." + # shellcheck disable=SC2086 $SUDO ${UPDATE_PKG_CACHE} &> /dev/null & spinner $! PIVPN_DEPS=(linux-headers-amd64 qrencode wireguard wireguard-tools wireguard-dkms) installDependentPackages PIVPN_DEPS[@] @@ -1191,6 +1194,7 @@ installWireGuard(){ echo "::: Installing WireGuard from PPA... " $SUDO add-apt-repository ppa:wireguard/wireguard -y + echo "::: Updating package cache..." # shellcheck disable=SC2086 $SUDO ${UPDATE_PKG_CACHE} &> /dev/null & spinner $! PIVPN_DEPS=(qrencode wireguard wireguard-tools wireguard-dkms linux-headers-generic) diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 23c06e3..b570fd1 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -114,9 +114,11 @@ removeAll(){ if [ "$PLAT" = "Debian" ] || { [ "$PLAT" = "Raspbian" ] && [ "$(uname -m)" = "armv7l" ]; }; then rm -f /etc/apt/sources.list.d/pivpn-unstable.list rm -f /etc/apt/preferences.d/pivpn-limit-unstable + echo "::: Updating package cache..." ${UPDATE_PKG_CACHE} &> /dev/null & spinner $! elif [ "$PLAT" = "Ubuntu" ]; then add-apt-repository ppa:wireguard/wireguard -r -y + echo "::: Updating package cache..." ${UPDATE_PKG_CACHE} &> /dev/null & spinner $! fi @@ -153,6 +155,7 @@ removeAll(){ if [ "$PLAT" = "Debian" ] || [ "$PLAT" = "Ubuntu" ]; then rm -f /etc/apt/sources.list.d/pivpn-openvpn-repo.list + echo "::: Updating package cache..." ${UPDATE_PKG_CACHE} &> /dev/null & spinner $! fi deluser openvpn diff --git a/scripts/wireguard/clientSTAT.sh b/scripts/wireguard/clientSTAT.sh index 93abc22..a63d176 100755 --- a/scripts/wireguard/clientSTAT.sh +++ b/scripts/wireguard/clientSTAT.sh @@ -13,7 +13,7 @@ hr(){ if DUMP="$(wg show wg0 dump)"; then DUMP="$(tail -n +2 <<< "$DUMP")" else - exit 1 + exit 1 fi printf "\e[1m::: Connected Clients List :::\e[0m\n"