From 390335eb45e3c6bb1c6d6ed51b34134d686326e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Sat, 6 Jan 2024 15:06:21 -0500 Subject: [PATCH] apeinstall/uninstall.sh can use doas (#1062) --- ape/apeinstall.sh | 7 ++++++- ape/apeuninstall.sh | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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 {