Send Heartbeat SMS (halbjaehrlich)
This commit is contained in:
parent
75ecf14c1a
commit
09548e3b15
5
REAME.md
5
REAME.md
|
|
@ -161,6 +161,11 @@ $ tar cvf /var/tmp/proxypi-git-files.tar .
|
|||
# systemctl disable avahi-daemon
|
||||
# systemctl disable triggerhappy
|
||||
|
||||
Cronjob einrichten:
|
||||
/etc/cron.d/send_sms:
|
||||
@reboot root sleep 30;/home/pi/root-bin/send_sms
|
||||
|
||||
|
||||
|
||||
Reboot:
|
||||
# init 6
|
||||
|
|
|
|||
|
|
@ -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
|
||||
Loading…
Reference in New Issue