mirror of https://github.com/ventoy/Ventoy.git
the modifications verify user privilege and prevent improper script execution.
This commit is contained in:
parent
81d3492a61
commit
ff3ce4da66
|
@ -18,6 +18,18 @@ print_usage() {
|
||||||
echo ''
|
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
|
while [ -n "$1" ]; do
|
||||||
if [ "$1" = "-s" ]; then
|
if [ "$1" = "-s" ]; then
|
||||||
shift
|
shift
|
||||||
|
|
Loading…
Reference in New Issue