|
|
@ -37,7 +37,7 @@ function assert_supported_distro { |
|
|
distro=$(grep -oP '^ID=\K(.*)' /etc/os-release) |
|
|
distro=$(grep -oP '^ID=\K(.*)' /etc/os-release) |
|
|
>&2 echo "unsupported GNU/Linux distribution: $distro" |
|
|
>&2 echo "unsupported GNU/Linux distribution: $distro" |
|
|
>&2 echo 'only debian-like OR arch-like currently supported' |
|
|
>&2 echo 'only debian-like OR arch-like currently supported' |
|
|
return |
|
|
|
|
|
|
|
|
return 10 |
|
|
fi |
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -54,14 +54,14 @@ function execute_miaou_lib { |
|
|
function assert_bash { |
|
|
function assert_bash { |
|
|
if [[ $SHELL != bash ]]; then |
|
|
if [[ $SHELL != bash ]]; then |
|
|
>&2 echo "you are running on SHELL=$SHELL. Bash expected!" |
|
|
>&2 echo "you are running on SHELL=$SHELL. Bash expected!" |
|
|
return |
|
|
|
|
|
|
|
|
return 11 |
|
|
fi |
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function sudo_root { |
|
|
function sudo_root { |
|
|
if [[ "$UID" -ne 0 ]] && ! sudo -vp 'SUDO privilege required: '; then |
|
|
if [[ "$UID" -ne 0 ]] && ! sudo -vp 'SUDO privilege required: '; then |
|
|
>&2 echo "canceled" |
|
|
>&2 echo "canceled" |
|
|
return |
|
|
|
|
|
|
|
|
return 12 |
|
|
fi |
|
|
fi |
|
|
} |
|
|
} |
|
|
## MAIN |
|
|
## MAIN |
|
|
|