iankelling.org
/
git
/
log-quiet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
failcam minor: shellcheck warnings
[log-quiet]
/
sysd-mail-once
diff --git
a/sysd-mail-once
b/sysd-mail-once
index d44b77fd48f35c0405be838fc20052b99604ae6f..3b87eea08dbc7c4f399786d4ce5dc4ecaab84adc 100755
(executable)
--- a/
sysd-mail-once
+++ b/
sysd-mail-once
@@
-55,7
+55,7
@@
shift
c=$cbase/$service # c for command file path base
c=$cbase/$service # c for command file path base
-glob="$
c
[0-9]*"
+glob="$
{c}
[0-9]*"
arr=($glob); file="${arr[0]}"; [[ $glob != "$file" ]] || file=
[[ -d $cbase ]] || mkdir -p $cbase
arr=($glob); file="${arr[0]}"; [[ $glob != "$file" ]] || file=
[[ -d $cbase ]] || mkdir -p $cbase
@@
-68,7
+68,7
@@
code=0
if (( code )); then
send_mail=false
if [[ $file ]]; then
if (( code )); then
send_mail=false
if [[ $file ]]; then
- i=${file#
$c
}
+ i=${file#
"$c"
}
if (( i < errors )); then
new_file=$c$((i+1))
mv $file $new_file
if (( i < errors )); then
new_file=$c$((i+1))
mv $file $new_file
@@
-90,7
+90,7
@@
To: $to
From: $USER@$(hostname -f)
Subject: $HOSTNAME: $service exit code: $code
From: $USER@$(hostname -f)
Subject: $HOSTNAME: $service exit code: $code
-$(journalctl -u $service.service --after-cursor=
$(<$file)
)
+$(journalctl -u $service.service --after-cursor=
"$(<$file)"
)
EOF
fi
else
EOF
fi
else