aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislas Lange <git@slange.me>2023-01-22 15:44:31 +0100
committerStanislas Lange <git@slange.me>2023-01-22 15:44:37 +0100
commitd36a6459a3e282f951f49e7b7f360ef3f6c692d4 (patch)
treeea585b15f9df519f0daca49d85c5041b8a12b46f
parentc97e3cc6b34a54941b052f979974d0929201ca7e (diff)
Don't auto remove dependencies when uninstalling
Fix https://github.com/angristan/wireguard-install/issues/301
-rw-r--r--wireguard-install.sh22
1 files changed, 8 insertions, 14 deletions
diff --git a/wireguard-install.sh b/wireguard-install.sh
index 79dd829..631ff63 100644
--- a/wireguard-install.sh
+++ b/wireguard-install.sh
@@ -431,28 +431,22 @@ function uninstallWg() {
systemctl disable "wg-quick@${SERVER_WG_NIC}"
if [[ ${OS} == 'ubuntu' ]]; then
- apt-get autoremove --purge -y wireguard qrencode
+ apt-get remove -y wireguard wireguard-tools qrencode
elif [[ ${OS} == 'debian' ]]; then
- apt-get autoremove --purge -y wireguard qrencode
+ apt-get remove -y wireguard wireguard-tools qrencode
elif [[ ${OS} == 'fedora' ]]; then
- dnf remove -y wireguard-tools qrencode
+ dnf remove -y --noautoremove wireguard-tools qrencode
if [[ ${VERSION_ID} -lt 32 ]]; then
- dnf remove -y wireguard-dkms
+ dnf remove -y --noautoremove wireguard-dkms
dnf copr disable -y jdoss/wireguard
fi
- dnf autoremove -y
- elif [[ ${OS} == 'almalinux' ]]; then
- dnf -y remove wireguard-tools qrencode
+ elif [[ ${OS} == 'centos' ]] || [[ ${OS} == 'almalinux' ]] || [[ ${OS} == 'rocky' ]]; then
+ yum remove -y --noautoremove wireguard-tools
if [[ ${VERSION_ID} == 8* ]]; then
- dnf -y remove kmod-wireguard
+ yum remove --noautoremove kmod-wireguard qrencode
fi
- dnf -y autoremove
- elif [[ ${OS} == 'centos' ]]; then
- yum -y remove kmod-wireguard wireguard-tools qrencode
- yum -y autoremove
elif [[ ${OS} == 'oracle' ]]; then
- yum -y remove wireguard-tools qrencode
- yum -y autoremove
+ yum remove --noautoremove wireguard-tools qrencode
elif [[ ${OS} == 'arch' ]]; then
pacman -Rs --noconfirm wireguard-tools qrencode
fi