basics.yml aktualisiert
This commit is contained in:
parent
c70eb028bb
commit
2cb8bbc874
20
basics.yml
20
basics.yml
@ -761,22 +761,33 @@
|
|||||||
message=$(echo -e "$subj\n$message")
|
message=$(echo -e "$subj\n$message")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
## SSH
|
||||||
if [ -n "$SSH_ORIGINAL_COMMAND" ]
|
if [ -n "$SSH_ORIGINAL_COMMAND" ]
|
||||||
then
|
then
|
||||||
subj=$(echo "$SSH_ORIGINAL_COMMAND" | sed 's#^/usr/local/bin/notify.sh##; s/^ *//; s/^\"//; s/\"$//')
|
subj=$(echo "$SSH_ORIGINAL_COMMAND" | sed 's#^/usr/local/bin/notify.sh##; s/^ *//; s/^\"//; s/\"$//')
|
||||||
message=$(echo -e "$subj$message")
|
message=$(echo -e "$subj$message")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
## MAIL
|
||||||
if [ -n "$tomail" ]
|
if [ -n "$tomail" ]
|
||||||
then
|
then
|
||||||
echo "$message" | mail -s "notify.sh: $subj" $tomail
|
echo "$message" | mail -s "notify.sh: $subj" $tomail
|
||||||
fi
|
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
|
then
|
||||||
echo "No Signal account?!"
|
docker compose -f /home/docker/matrix.$(hostname)/docker-compose.yml run -T matrix.$(hostname)--commander -m "$message" --log-level WARNING WARNING
|
||||||
exit 1
|
|
||||||
fi
|
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/+/_/')
|
account=$(cat /home/signal/.local/share/signal-cli/data/accounts.json | jq -r '.accounts[0].number' | sed 's/+/_/')
|
||||||
if [ -z "$account" ]
|
if [ -z "$account" ]
|
||||||
then
|
then
|
||||||
@ -784,7 +795,6 @@
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -n "$togroup" ]
|
if [ -n "$togroup" ]
|
||||||
then
|
then
|
||||||
# Send to group via dbus
|
# Send to group via dbus
|
||||||
@ -803,7 +813,7 @@
|
|||||||
# Sent to a single Number via dbus
|
# 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 '
|
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
|
||||||
|
fi
|
||||||
backup: yes
|
backup: yes
|
||||||
validate: /bin/bash -n %s
|
validate: /bin/bash -n %s
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user