summaryrefslogtreecommitdiffstats
path: root/scripts/zfs.sh
diff options
context:
space:
mode:
authorGiuseppe Di Natale <[email protected]>2017-03-09 10:20:15 -0800
committerBrian Behlendorf <[email protected]>2017-03-09 10:20:15 -0800
commitc552fbc5f025f3c1e74b85c1c0d536ee272defd0 (patch)
tree4ae7a1c1b195703d748d030b1f94ecb701ed5199 /scripts/zfs.sh
parent9b77d1c9585572b7ce3af204d40278752d5f5842 (diff)
Enable shellcheck to run for select scripts
Enable shellcheck to run on zed scripts, paxcheck.sh, zfs-tests.sh, zfs.sh, and zloop.sh. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes #5812
Diffstat (limited to 'scripts/zfs.sh')
-rwxr-xr-xscripts/zfs.sh12
1 files changed, 5 insertions, 7 deletions
diff --git a/scripts/zfs.sh b/scripts/zfs.sh
index 55584ddd1..2ffcf40da 100755
--- a/scripts/zfs.sh
+++ b/scripts/zfs.sh
@@ -2,7 +2,7 @@
#
# A simple script to simply the loading/unloading the ZFS module stack.
-basedir="$(dirname $0)"
+basedir=$(dirname "$0")
SCRIPT_COMMON=common.sh
if [ -f "${basedir}/${SCRIPT_COMMON}" ]; then
@@ -11,6 +11,7 @@ else
echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
fi
+# shellcheck disable=SC2034
PROG=zfs.sh
UNLOAD=
@@ -26,7 +27,6 @@ OPTIONS:
-h Show this message
-v Verbose
-u Unload modules
- -d Save debug log on unload
MODULE-OPTIONS:
Must be of the from module="options", for example:
@@ -37,21 +37,19 @@ $0 zfs="zfs_prefetch_disable=1 zfs_mdcomp_disable=1"
EOF
}
-while getopts 'hvud' OPTION; do
+while getopts 'hvu' OPTION; do
case $OPTION in
h)
usage
exit 1
;;
v)
+ # shellcheck disable=SC2034
VERBOSE=1
;;
u)
UNLOAD=1
;;
- d)
- DUMP_LOG=1
- ;;
?)
usage
exit
@@ -59,7 +57,7 @@ while getopts 'hvud' OPTION; do
esac
done
-if [ $(id -u) != 0 ]; then
+if [ "$(id -u)" != 0 ]; then
die "Must run as root"
fi