diff options
| author | Vedang Manerikar <ved.manerikar@gmail.com> | 2025-12-30 21:05:59 +0530 |
|---|---|---|
| committer | Vedang Manerikar <ved.manerikar@gmail.com> | 2025-12-30 21:05:59 +0530 |
| commit | 8ba098a31807aa7541876ca5c2f7df07e2497767 (patch) | |
| tree | 54c04ab31c1e289be5cae335a8c67fd45c90cb33 | |
| parent | ce2da3ba62c06e12a79ea8abb6b3f37cf48e7d9c (diff) | |
fix(autobuild): add doas as privilege escalation fallback
Alpine Linux deprecated sudo in favor of doas. Add doas support to
exec_privileged() so autobuild works on Alpine without requiring users
to install and configure sudo.
Fixes #323
| -rwxr-xr-x | server/autobuild | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/server/autobuild b/server/autobuild index beef702..6166c62 100755 --- a/server/autobuild +++ b/server/autobuild @@ -95,10 +95,12 @@ exec_privileged() { retval=$? sudo -k return $retval + elif which doas >/dev/null 2>&1; then + doas -- "$@" elif which su >/dev/null 2>&1; then su -c "$(quote "$@")" else - echo "No such program: sudo or su" + echo "No such program: sudo, doas or su" exit 1 fi } |
