the modifications verify user privilege and prevent improper script execution.
This commit is contained in:
Henrique
2022-09-12 23:18:12 +08:00
committed by GitHub
parent 81d3492a61
commit ff3ce4da66
+12
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