Alpine: check root

pull/86/head
Meo597 2025-04-12 00:40:41 +08:00
parent 927efe0710
commit 1a1f0f6d38
1 changed files with 11 additions and 0 deletions

View File

@ -66,6 +66,16 @@ check_alpine() {
fi
}
check_if_running_as_root() {
# If you want to run as another user, please modify $EUID to be owned by this user
if [ "$(id -u)" -eq 0 ]; then
return 0
else
echo "error: You must run this script as root!"
return 1
fi
}
install_software() {
if [[ -n "$(command -v curl)" ]]; then
return
@ -192,6 +202,7 @@ information() {
main() {
check_alpine || return 1
check_if_running_as_root || return 1
install_software
download_xray
verification_xray