mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Use an array for PKG_REMOVE
Fixes shellcheck warning. Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
parent
b6700924b2
commit
951732fc1b
1 changed files with 3 additions and 3 deletions
|
@ -55,13 +55,13 @@ fi
|
||||||
# Compatability
|
# Compatability
|
||||||
if [ -x "$(command -v apt-get)" ]; then
|
if [ -x "$(command -v apt-get)" ]; then
|
||||||
# Debian Family
|
# Debian Family
|
||||||
PKG_REMOVE="${PKG_MANAGER} -y remove --purge"
|
PKG_REMOVE=("${PKG_MANAGER}" -y remove --purge)
|
||||||
package_check() {
|
package_check() {
|
||||||
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed"
|
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed"
|
||||||
}
|
}
|
||||||
elif [ -x "$(command -v rpm)" ]; then
|
elif [ -x "$(command -v rpm)" ]; then
|
||||||
# Fedora Family
|
# Fedora Family
|
||||||
PKG_REMOVE="${PKG_MANAGER} remove -y"
|
PKG_REMOVE=("${PKG_MANAGER}" remove -y)
|
||||||
package_check() {
|
package_check() {
|
||||||
rpm -qa | grep "^$1-" > /dev/null
|
rpm -qa | grep "^$1-" > /dev/null
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ removeAndPurge() {
|
||||||
case ${yn} in
|
case ${yn} in
|
||||||
[Yy]* )
|
[Yy]* )
|
||||||
echo -ne " ${INFO} Removing ${i}...";
|
echo -ne " ${INFO} Removing ${i}...";
|
||||||
${SUDO} ${PKG_REMOVE} "${i}" &> /dev/null;
|
${SUDO} "${PKG_REMOVE}" "${i}" &> /dev/null;
|
||||||
echo -e "${OVER} ${INFO} Removed ${i}";
|
echo -e "${OVER} ${INFO} Removed ${i}";
|
||||||
break;;
|
break;;
|
||||||
[Nn]* ) echo -e " ${INFO} Skipped ${i}"; break;;
|
[Nn]* ) echo -e " ${INFO} Skipped ${i}"; break;;
|
||||||
|
|
Loading…
Reference in a new issue