fix sudo_root for root
This commit is contained in:
+2
-1
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user