From de5dd52d363913bf684aa232c027d1b83fe444d9 Mon Sep 17 00:00:00 2001 From: Olav Vitters Date: Sat, 25 Jul 2020 14:32:42 +0200 Subject: del-service: ShellCheck fix quoting issues some are on purpose, so leaving those in. Fixing properly is too much effort --- del-service | 16 ++++++++-------- 1 file 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 -- cgit v1.2.1