Skip to content

Commit 2e02bf1

Browse files
committed
[update] : Added root check
1 parent b949fef commit 2e02bf1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/clean.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ if [[ ! -v work_dir ]] && [[ "${work_dir}" = "" ]]; then
138138
exit 1
139139
fi
140140

141+
# Check root.
142+
if (( ! "${EUID}" == 0 )); then
143+
msg_error "This script must be run as root." "1"
144+
fi
145+
141146
if [[ ! "${noconfirm}" = true ]] && (( "$(find "${work_dir}" -type f 2> /dev/null | wc -l)" != 0 )); then
142147
msg_warn "Forcibly unmount all devices mounted under the following directories and delete them recursively."
143148
msg_warn "${work_dir}"

0 commit comments

Comments
 (0)