the modifications verify user privilege and prevent improper script execution.
This commit is contained in:
Henrique 2022-09-12 12:18:12 -03:00 committed by GitHub
parent 81d3492a61
commit ff3ce4da66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -18,6 +18,18 @@ print_usage() {
echo ''
}
print_err() {
echo ""
echo "$*"
echo ""
}
uid=$(id -u)
if [ $uid -ne 0 ]; then
print_err "Please use sudo or run the script as root."
exit 1
fi
while [ -n "$1" ]; do
if [ "$1" = "-s" ]; then
shift