Send Heartbeat SMS (halbjaehrlich)

This commit is contained in:
Joerg Lehmann 2018-04-25 17:26:59 +02:00
parent 75ecf14c1a
commit 09548e3b15
2 changed files with 29 additions and 0 deletions

View File

@ -161,6 +161,11 @@ $ tar cvf /var/tmp/proxypi-git-files.tar .
# systemctl disable avahi-daemon # systemctl disable avahi-daemon
# systemctl disable triggerhappy # systemctl disable triggerhappy
Cronjob einrichten:
/etc/cron.d/send_sms:
@reboot root sleep 30;/home/pi/root-bin/send_sms
Reboot: Reboot:
# init 6 # init 6

24
root-bin/send_sms Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
#
# Sendet mindestens einmal pro Halbjahr eine Test-SMS,
# damit der Prepaid Account nicht wegen Nicht-Benutzung gesperrt
# wird.
#
# 25.4.2018 - Joerg Lehmann
#
MONTH="$(date +%m)"
STATE_DIR=/var/tmp
case ${MONTH} in
0[1-6]) HY=1
;;
*) HY=2
;;
esac
if [ ! -f ${STATE_DIR}/sms-sent.${HY} ]; then
rm ${STATE_DIR}/sms-sent.* 2>/dev/null
touch ${STATE_DIR}/sms-sent.${HY}
echo "Sending Test SMS for Half-Year ${HY}..."
gammu sendsms TEXT 0765006123 -text "Heartbeat from ProxyPi..."
fi