From 2d2da9c7553d344e9a70b953bfb60bd4fb00a2ab Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Mon, 9 Jan 2023 18:33:22 +0000 Subject: [PATCH] Update file run_onchange_before_10-remove-bloatware.tmpl --- .../run_onchange_before_10-remove-bloatware.tmpl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/home/.chezmoiscripts/_universal/run_onchange_before_10-remove-bloatware.tmpl b/home/.chezmoiscripts/_universal/run_onchange_before_10-remove-bloatware.tmpl index 033bc4ba..6f612f25 100644 --- a/home/.chezmoiscripts/_universal/run_onchange_before_10-remove-bloatware.tmpl +++ b/home/.chezmoiscripts/_universal/run_onchange_before_10-remove-bloatware.tmpl @@ -10,11 +10,22 @@ for PKG in {{ $removePackages }}; do sudo apt-get remove -y "$PKG" fi elif command -v dnf > /dev/null; then - if + if rpm -qa | grep "$PKG" > /dev/null; then + sudo dnf remove -y "$PKG" + fi elif command -v yum > /dev/null; then + if rpm -qa | grep "$PKG" > /dev/null; then + sudo yum remove -y "$PKG" + fi elif command -v pacman > /dev/null; then if pacman -Qs "$PKG" > /dev/null; then sudo pacman -R "$PKG" fi + elif command -v zypper > /dev/null; then + if rpm -qa | grep "$PKG" > /dev/null; then + sudo zypper remove -y "$PKG" + fi fi -done \ No newline at end of file +done + +{{- end }}