1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

dist/tools/tapsetup: make compatible with doas

`doas` doesn't set `SUDO_USER`, but `DOAS_USER`. This populates
`SUDO_USER` with `DOAS_USER` if it is empty, so the script works with
both doas and sudo.
This commit is contained in:
Marian Buschsieweke 2024-05-30 09:38:44 +02:00
parent 251ea7f75a
commit d05d33f636
No known key found for this signature in database
GPG Key ID: 77AA882EC78084E6

View File

@ -13,6 +13,10 @@ BRIDGE_ROUTES=""
DEFAULT_PREFIX_LEN=128
UPLINK=""
# doas uses the DOAS_USER variable instead of SUDO_USER. For compatibility with
# both, we populate SUDO_USER with DOAS_USER, if SUDO_USER is not existing.
: "${SUDO_USER:="$DOAS_USER"}"
usage() {
echo "usage: ${PROGRAM} [arguments]" >&2
echo "" >&2