Support doas and su for root authentication (#593)

This commit is contained in:
Amar Al-Zubaidi
2022-09-21 12:26:23 -05:00
committed by GitHub
parent d16833bbf8
commit 4a9f4d3145

View File

@@ -17,6 +17,14 @@ set -e
_where=`pwd`
srcdir="$_where"
# Command used for superuser privileges (`sudo`, `doas`, `su`)
if [ ! -x "$(command -v sudo)" ]; then
if [ -x "$(command -v doas)" ]; then sudo() { doas "$@"; }
elif [ -x "$(command -v su)" -a -x "$(command -v xargs)" ]; then
sudo() { echo "$@" | xargs -I {} su -c '{}'; }
fi
fi
source customization.cfg
source linux-tkg-config/prepare