iankelling.org
/
git
/
log-quiet
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fd32c8b
)
use world readable log dir if running as root
master
author
Ian Kelling
<iank@fsf.org>
Wed, 9 Oct 2024 05:48:25 +0000
(
01:48
-0400)
committer
Ian Kelling
<iank@fsf.org>
Wed, 9 Oct 2024 05:48:25 +0000
(
01:48
-0400)
sysd-mail-once
patch
|
blob
|
history
diff --git
a/sysd-mail-once
b/sysd-mail-once
index 2c9d0263748e9b715acddb5bf3c0d57d28bb1dd9..a3eb11d12e88767c7a70ea02fa535619eb5dcf01 100755
(executable)
--- a/
sysd-mail-once
+++ b/
sysd-mail-once
@@
-26,8
+26,13
@@
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
errors=3
-tmp=(~)
-cbase="${tmp[0]}/sysd-mail-once-state"
+if [[ $EUID == 0 ]]; then
+ cbase=/var/local/sysd-mail-once
+else
+ # (~) note: will work even if HOME is not set.
+ tmp=(~)
+ cbase="${tmp[0]}/sysd-mail-once-state"
+fi
to=root
dryrun=false
print_all=false