Skip to content

Commit

Permalink
Check for root permissions.
Browse files Browse the repository at this point in the history
Fixes #4.
  • Loading branch information
dak180 committed Dec 15, 2024
1 parent 526d979 commit 3bbdd1c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions disk-burnin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,13 @@ for command in "${commands[@]}"; do
done


# Must be run as root for effect
if [ ! "$(whoami)" = "root" ] && [ ! "${Dry_Run}" = "0" ]; then
echo "Must be run as root." >&2
exit 1
fi


if [ ! -z "${driveIDs}" ]; then
IFS=' ' read -ra devIDs <<< "${driveIDs}"
for devID in "${devIDs[@]}"; do
Expand Down

0 comments on commit 3bbdd1c

Please sign in to comment.