mirror of
https://github.com/Spearfoot/disk-burnin-and-testing.git
synced 2025-12-05 23:53:31 +00:00
check if running as root
This commit is contained in:
6
disk-burnin.sh
Normal file → Executable file
6
disk-burnin.sh
Normal file → Executable file
@@ -140,6 +140,12 @@ for dependency in ${DEPENDENCIES}; do
|
||||
fi
|
||||
done
|
||||
|
||||
# Check if running as root
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Please run as root. Exiting ..."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Check script arguments
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Error: not enough arguments!"
|
||||
|
||||
Reference in New Issue
Block a user