From 9f6bf6ea71e1385cc34dab0c492773f428d62869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven=20Dee=20=28J=C5=8Dshin=29?= Date: Mon, 13 Jan 2025 16:48:55 -0800 Subject: [PATCH] tool/zsh/mkofs: doas --- tool/zsh/mkofs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tool/zsh/mkofs b/tool/zsh/mkofs index 8018d493a..9e3c8146c 100644 --- a/tool/zsh/mkofs +++ b/tool/zsh/mkofs @@ -17,7 +17,12 @@ cut -d' ' -f2 /proc/mounts | while read -r line; do return 0 fi done +if whence doas >/dev/null; then + doas=doas +else + doas=sudo +fi ( set -x - sudo mount -t tmpfs -o size=10G,noatime,nodiratime /dev/shm "$o" + $doas mount -t tmpfs -o size=10G,noatime,nodiratime /dev/shm "$o" ) # vim:ft=zsh