mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 12:48:14 -05:00
fix: EUID is a readonly variable on some shells (#379)
This commit is contained in:
parent
61127b3435
commit
61e16f96c5
@ -24,8 +24,8 @@ os_arch=""
|
||||
[ -e /etc/os-release ] && grep -i "PRETTY_NAME" /etc/os-release | grep -qi "alpine" && os_alpine='1'
|
||||
|
||||
sudo() {
|
||||
EUID=$(id -ru)
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
myEUID=$(id -ru)
|
||||
if [ "$myEUID" -ne 0 ]; then
|
||||
if command -v sudo > /dev/null 2>&1; then
|
||||
command sudo "$@"
|
||||
else
|
||||
|
@ -24,8 +24,8 @@ os_arch=""
|
||||
[ -e /etc/os-release ] && grep -i "PRETTY_NAME" /etc/os-release | grep -qi "alpine" && os_alpine='1'
|
||||
|
||||
sudo() {
|
||||
EUID=$(id -ru)
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
myEUID=$(id -ru)
|
||||
if [ "$myEUID" -ne 0 ]; then
|
||||
if command -v sudo > /dev/null 2>&1; then
|
||||
command sudo "$@"
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user