mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Fix SC2181 ("[ $?") outside tests/
Reviewed-by: John Kennedy <john.kennedy@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12042
This commit is contained in:
+9
-13
@@ -61,20 +61,16 @@ do_stop()
|
||||
check_module_loaded "zfs" || exit 0
|
||||
|
||||
zfs_action "Stopping ZFS Event Daemon" zfs_daemon_stop \
|
||||
"$ZED_PIDFILE" "$ZED" "$ZED_NAME"
|
||||
if [ "$?" -eq "0" ]
|
||||
"$ZED_PIDFILE" "$ZED" "$ZED_NAME" || return "$?"
|
||||
|
||||
# Let's see if we have any pools imported
|
||||
pools=$("$ZPOOL" list -H -oname)
|
||||
if [ -z "$pools" ]
|
||||
then
|
||||
# Let's see if we have any pools imported
|
||||
pools=$("$ZPOOL" list -H -oname)
|
||||
if [ -z "$pools" ]
|
||||
then
|
||||
# No pools imported, it is/should be safe/possible to
|
||||
# unload modules.
|
||||
zfs_action "Unloading modules" rmmod zfs zunicode \
|
||||
zavl zcommon znvpair zlua spl
|
||||
return "$?"
|
||||
fi
|
||||
else
|
||||
# No pools imported, it is/should be safe/possible to
|
||||
# unload modules.
|
||||
zfs_action "Unloading modules" rmmod zfs zunicode \
|
||||
zavl zcommon znvpair zlua spl
|
||||
return "$?"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -182,15 +182,17 @@ zfs_daemon_stop()
|
||||
# LSB functions
|
||||
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
|
||||
--pidfile "$PIDFILE" --name "$DAEMON_NAME"
|
||||
[ "$?" = 0 ] && rm -f "$PIDFILE"
|
||||
ret="$?"
|
||||
[ "$ret" = 0 ] && rm -f "$PIDFILE"
|
||||
|
||||
return $?
|
||||
return "$ret"
|
||||
elif type killproc > /dev/null 2>&1 ; then
|
||||
# Fedora/RedHat functions
|
||||
killproc -p "$PIDFILE" "$DAEMON_NAME"
|
||||
[ "$?" = 0 ] && rm -f "$PIDFILE"
|
||||
ret="$?"
|
||||
[ "$ret" = 0 ] && rm -f "$PIDFILE"
|
||||
|
||||
return $?
|
||||
return "$ret"
|
||||
else
|
||||
# Unsupported
|
||||
return 3
|
||||
@@ -371,7 +373,7 @@ in_mtab()
|
||||
local mntpnt="$1"
|
||||
# Remove 'unwanted' characters.
|
||||
mntpnt=$(printf '%b\n' "$mntpnt" | sed -e 's,/,,g' \
|
||||
-e 's,-,,g' -e 's,\.,,g' -e 's, ,,g')
|
||||
-e 's,-,,g' -e 's,\.,,g' -e 's, ,,g')
|
||||
local var
|
||||
|
||||
var="$(eval echo MTAB_$mntpnt)"
|
||||
|
||||
Reference in New Issue
Block a user