diff --git a/ape/apeinstall.sh b/ape/apeinstall.sh index 6037bf959..d8422e11a 100755 --- a/ape/apeinstall.sh +++ b/ape/apeinstall.sh @@ -18,8 +18,13 @@ fi if [ "$(id -u)" -eq 0 ]; then SUDO= -else +elif command -v sudo >/dev/null 2>&1; then SUDO=sudo +elif command -v doas >/dev/null 2>&1; then + SUDO=doas +else + echo "need root or sudo" >&2 + exit fi if command -v install >/dev/null 2>&1; then diff --git a/ape/apeuninstall.sh b/ape/apeuninstall.sh index 70cff8452..17d84145f 100755 --- a/ape/apeuninstall.sh +++ b/ape/apeuninstall.sh @@ -11,8 +11,13 @@ fi if [ "$UID" = "0" ]; then SUDO= -else +elif command -v sudo >/dev/null 2>&1; then SUDO=sudo +elif command -v doas >/dev/null 2>&1; then + SUDO=doas +else + echo "need root or sudo" >&2 + exit fi {