basics.yml aktualisiert

This commit is contained in:
olli 2024-02-21 17:37:31 +01:00
parent c70eb028bb
commit 2cb8bbc874

View File

@ -761,22 +761,33 @@
message=$(echo -e "$subj\n$message")
fi
## SSH
if [ -n "$SSH_ORIGINAL_COMMAND" ]
then
subj=$(echo "$SSH_ORIGINAL_COMMAND" | sed 's#^/usr/local/bin/notify.sh##; s/^ *//; s/^\"//; s/\"$//')
message=$(echo -e "$subj$message")
fi
## MAIL
if [ -n "$tomail" ]
then
echo "$message" | mail -s "notify.sh: $subj" $tomail
fi
if ! [ -f /home/signal/.local/share/signal-cli/data/accounts.json ]
## MATRIX
if [ -f /home/docker/matrix.$(hostname)/matrix-commander-data/credentials.json ]
then
echo "No Signal account?!"
exit 1
docker compose -f /home/docker/matrix.$(hostname)/docker-compose.yml run -T matrix.$(hostname)--commander -m "$message" --log-level WARNING WARNING
fi
## SIGNAL
if [ -f /home/signal/.local/share/signal-cli/data/accounts.json ]
then
account=$(cat /home/signal/.local/share/signal-cli/data/accounts.json | jq -r '.accounts[0].number' | sed 's/+/_/')
if [ -z "$account" ]
then
@ -784,7 +795,6 @@
exit 1
fi
if [ -n "$togroup" ]
then
# Send to group via dbus
@ -803,7 +813,7 @@
# Sent to a single Number via dbus
dbus-send --system --type=method_call --print-reply --dest="org.asamk.Signal" /org/asamk/Signal/${account} org.asamk.Signal.sendMessage string:"${message}" array:string: string:${to} | egrep -v '^method return time=|^ int64 '
fi
fi
backup: yes
validate: /bin/bash -n %s