Skip to content

Commit b949fef

Browse files
committed
[fix] : Fixed help message
1 parent 5a17460 commit b949fef

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tools/umount.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ umount_work () {
9797
}
9898

9999

100-
# Check root.
101-
if (( ! "${EUID}" == 0 )); then
102-
msg_error "This script must be run as root." "1"
103-
fi
104-
105100
# Parse options
106101
OPTS=("d" "f" "h" "m:")
107102
OPTL=("debug" "force" "help" "maxdepth:")
@@ -128,7 +123,7 @@ while true; do
128123
shift 2
129124
;;
130125
-h | --help)
131-
_usage
126+
_help
132127
exit 0
133128
;;
134129
--)
@@ -137,11 +132,17 @@ while true; do
137132
;;
138133
*)
139134
msg_error "Invalid argument '${1}'"
140-
_usage 1
135+
_help
136+
exit 1
141137
;;
142138
esac
143139
done
144140

141+
# Check root.
142+
if (( ! "${EUID}" == 0 )); then
143+
msg_error "This script must be run as root." "1"
144+
fi
145+
145146

146147
if [[ -z "${1+SET}" ]]; then
147148
msg_error "Please specify the target directory." "1"

0 commit comments

Comments
 (0)