commit 3b2a246830e5e9ff21357d69fabdaed62dcb68a9
parent 3da07472994cc2c06a855c70e0a9fa18c467f86c
Author: Andrew Laack <andrew@laack.co>
Date: Mon, 13 Apr 2026 13:31:53 -0500
Notifications with gotify + email + encrypted emails
Diffstat:
6 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/backup.sh b/backup.sh
@@ -8,10 +8,11 @@ source ~/.bashrc
if ~/bin/backups/simple.sh | tee ~/logs/backup.log 2>&1; then
echo "PASS: Backup Success" | tee -a ~/logs/backup.log
- echo "PASS: Backup Success" | email-send.sh
+ # Don't notify in positive case.
+ # echo "PASS: Backup Success" | email-send.sh "Backup succeeded"
date | tee -a ~/logs/backup-times.txt
else
echo "FAIL: Backup Failed" | tee -a ~/logs/backup.log
- echo "FAIL: Backup Failed" | email-send.sh
+ echo "FAIL: Backup Failed" | email-send.sh "Backup failed"
fi
diff --git a/decrypt.sh b/decrypt.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+gpg --batch --yes --decrypt --passphrase "$ENCRYPTION_PW" -o "$2" "$1"
diff --git a/email/email-send.sh b/email/email-send.sh
@@ -4,6 +4,9 @@
# Reads message from stdin
# If there is no subject it sends "Message from {hostname}"
+# TODO: This isn't consistent with the gotify thing; is this fine?
+# gotify stuff will probably be much shorter so maybe?
+
set -eo pipefail
UUID=$(uuidgen)
diff --git a/encrypt.sh b/encrypt.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+gpg --batch --yes -c --passphrase "$ENCRYPTION_PW" -o $2 $1
diff --git a/gotify/gotify-send.sh b/gotify/gotify-send.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+curl "https://gotify.andrew.selfhost.imbue.com/message?token=$GOTIFY_BASH_TOKEN" -F "title=$1" -F "message=$2" -F "priority=5"
diff --git a/rmount.sh b/rmount.sh
@@ -7,5 +7,6 @@ SELECTION=$(rclone listremotes | fzf)
if [[ -z "$SELECTION" ]]; then
echo "No selection made."
else
- rclone mount $SELECTION/ $HOME/mount --daemon
+ umount $HOME/mount || true
+ rclone mount $SELECTION/ $HOME/mount --daemon --vfs-cache-mode full --dir-cache-time=1s
fi