fix(install_server.sh): sudo with $@

This commit is contained in:
Haruue Icymoon 2022-11-28 13:22:39 +08:00
parent e2cc0dff48
commit 173d3a5a1d
No known key found for this signature in database
GPG Key ID: F6083B28CBCBC148

View File

@ -17,6 +17,9 @@ set -e
# Basename of this script
SCRIPT_NAME="$(basename "$0")"
# Command line arguments of this script
SCRIPT_ARGS=("$@")
# Path for installing executable
EXECUTABLE_INSTALL_PATH="/usr/local/bin/hysteria"
@ -272,8 +275,7 @@ check_permission() {
*)
if has_command sudo; then
note "Re-running this script with sudo, you can also specify FORCE_NO_ROOT=1 to force this script running with current user."
sudo "$0" "$@"
exit $?
exec sudo "$0" "${SCRIPT_ARGS[@]}"
else
error "Please run this script with root or specify FORCE_NO_ROOT=1 to force this script running with current user."
exit 13