fix sudo_root for root

This commit is contained in:
pvincent
2026-09-02 14:06:10 +04:00
parent 2b59290ac3
commit 8123105088
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -1,7 +1,8 @@
## library of useful functions, usually prefixed with '_' ## library of useful functions, usually prefixed with '_'
function sudo_root { function sudo_root {
[[ "$UID" -ne 0 ]] && sudo -vp 'SUDO privilege required: ' 2>/dev/null [[ $UID == 0 ]] && return
sudo -vp 'SUDO privilege required: ' 2>/dev/null
} }
## ASSERT Functions ## ASSERT Functions
+2 -2
View File
@@ -19,7 +19,7 @@ function container_upgrade {
fi fi
echo ' (Ctrl-c to bypass)' echo ' (Ctrl-c to bypass)'
if sudo_root; then if sudo_root; then
sudo -E miaou-bash "$MIAOU_BASH_DIR"/lib/initiate.bash sudo -E "$MIAOU_BASH_DIR"/bin/miaou-bash "$MIAOU_BASH_DIR"/lib/initiate.bash
else else
builtin exit 1 builtin exit 1
fi fi
@@ -56,7 +56,7 @@ function system_upgrade {
if [[ "$current" == "$latest" ]]; then if [[ "$current" == "$latest" ]]; then
echo "up-to-date version: $current (Ctrl-c to bypass reinitialization)" echo "up-to-date version: $current (Ctrl-c to bypass reinitialization)"
if sudo_root; then if sudo_root; then
sudo miaou-bash "$MIAOU_BASH_DIR"/lib/initiate.bash sudo -E "$MIAOU_BASH_DIR"/bin/miaou-bash "$MIAOU_BASH_DIR"/lib/initiate.bash
else else
builtin exit 1 builtin exit 1
fi fi