aboutsummaryrefslogtreecommitdiffstats
path: root/del-service
diff options
context:
space:
mode:
authorOlav Vitters <olav@vitters.nl>2020-07-25 14:32:42 +0200
committerOlav Vitters <olav@vitters.nl>2020-07-25 14:32:42 +0200
commitde5dd52d363913bf684aa232c027d1b83fe444d9 (patch)
treeb28c8b6df9be4b410b5e970f9728c23a90662ab2 /del-service
parent7dffce6cbb3e7bc8f70821a948e127d90e2b0538 (diff)
downloadrpm-helper-de5dd52d363913bf684aa232c027d1b83fe444d9.tar
rpm-helper-de5dd52d363913bf684aa232c027d1b83fe444d9.tar.gz
rpm-helper-de5dd52d363913bf684aa232c027d1b83fe444d9.tar.bz2
rpm-helper-de5dd52d363913bf684aa232c027d1b83fe444d9.tar.xz
rpm-helper-de5dd52d363913bf684aa232c027d1b83fe444d9.zip
del-service: ShellCheck fix quoting issues
some are on purpose, so leaving those in. Fixing properly is too much effort
Diffstat (limited to 'del-service')
-rwxr-xr-xdel-service16
1 files changed, 8 insertions, 8 deletions
diff --git a/del-service b/del-service
index ac1f7e7..6b9984b 100755
--- a/del-service
+++ b/del-service
@@ -10,7 +10,7 @@
# service.
#---------------------------------------------------------------
-if [ x$1 = x--no-sysv ]; then
+if [ x"$1" = x--no-sysv ]; then
do_sysv=no
shift
else
@@ -45,7 +45,7 @@ RUNTIMEUNITDIR=/run/systemd/system
SYSTEMUNITDIR=/lib/systemd/system
find_unit() {
- unit=$(basename $1)
+ unit=$(basename "$1")
# We need to normalise the systemd unit name as the native unit may not have
# the same filename (sans it's .service suffix) as sysvinit script.
@@ -67,7 +67,7 @@ find_unit() {
searchunit="$SYSTEMUNITDIR/$unit"
fi
if [ -n "$searchunit" ]; then
- echo -n $searchunit
+ echo -n "$searchunit"
fi
}
@@ -77,25 +77,25 @@ find_unit() {
# catch the most common usage.
if [ -z "$units" ]; then
units="$srv.service"
- searchunit=$(find_unit $units)
+ searchunit=$(find_unit "$units")
if [ -n "$searchunit" ]; then
- units=$(basename $searchunit)
+ units=$(basename "$searchunit")
fi
fi
-if [ $num = 0 ]; then
+if [ "$num" = 0 ]; then
if [ -z "$DURING_INSTALL" ]; then
if [ x$init = xsystemd ]; then
/bin/systemctl stop $units >/dev/null 2>&1
- elif [ -n "srv" ]; then
+ elif [ -n "$srv" ]; then
/sbin/service $srv stop > /dev/null || :
fi
fi
/bin/systemctl --no-reload --quiet disable $units >/dev/null 2>&1
if [ -n "$srv" ]; then
- if [ -f /etc/rc.d/init.d/$srv -o -f /etc/xinetd.d/$srv ]; then
+ if [ -f /etc/rc.d/init.d/$srv ] || [ -f /etc/xinetd.d/$srv ]; then
/sbin/chkconfig --del $srv
fi
fi