Assorted shell and Python scripts

Use env file for ntfy server var

Changed files
+7 -6
+7 -6
archivebox_schedule
···
set -euo pipefail
# Check if feed URL is supplied.
-
if (( "${#@}" == 0 )); then
+
if (("${#@}" == 0)); then
echo "No feed URL has been supplied."
exit 1
fi
-
# Get Headnet IP address for desktop
-
SERVER_IP=$(sudo tailscale status | grep "dietpi" | awk '{print $1}')
+
if test -f "${HOME}/.env_common"; then
+
source "${HOME}/.env_common"
+
fi
# Go to archivebox directory and run scheduled command for supplied
# feed URL. Send ntfy an error message if it fails.
cd /naspool/archivebox
if ! /home/jas/.local/bin/archivebox add --depth=1 "$1" \
-
>> /naspool/archivebox/logs/schedule.log; then
+
>>/naspool/archivebox/logs/schedule.log; then
curl \
-H prio:urgent \
-H tags:warning \
-d "Error running archivebox schedule for $1" \
-
"http://${SERVER_IP}:8080/archivebox_schedule"
+
"${NTFY_SERVER}/archivebox_schedule"
else
curl \
-H prio:default \
-H tags:incoming_envelope \
-d "archivebox schedule succeeded: $1" \
-
"http://${SERVER_IP}:8080/archivebox_schedule"
+
"${NTFY_SERVER}/archivebox_schedule"
fi