Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
9bbe468c
Commit
9bbe468c
authored
Dec 28, 2025
by
shaw
Browse files
fix: 修复安装脚本通过 pipe 执行时 root 权限检查失效的问题
使用 `id -u` 替代 `$EUID` 进行 root 权限检查。 `$EUID` 是 bash 内置变量,在通过 pipe 执行脚本时可能不可靠。
parent
fbdff4f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
deploy/install.sh
View file @
9bbe468c
...
...
@@ -404,7 +404,9 @@ configure_server() {
# Check if running as root
check_root
()
{
if
[
"
$EUID
"
-ne
0
]
;
then
# Use 'id -u' instead of $EUID for better compatibility
# $EUID may not work reliably when script is piped to bash
if
[
"
$(
id
-u
)
"
-ne
0
]
;
then
print_error
"
$(
msg
'run_as_root'
)
"
exit
1
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment