From 915c0e414a102e244aa4b3b3ca9b3aa1a94fe50a Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Sat, 13 Apr 2019 00:20:59 +0200 Subject: [PATCH] epic-ts --- TestXfhem/FitnessePages/TestWatchdog/.dummy | 0 TestXfhem/FitnessePages/content.txt | 2 + TestXfhem/FitnessePages/properties.xml | 11 +++++ xfhem/bin/xfhem | 51 +++++++++++++++++++++ xfhem/etc/wagnertech.cfg | 2 + 5 files changed, 66 insertions(+) create mode 100644 TestXfhem/FitnessePages/TestWatchdog/.dummy create mode 100644 TestXfhem/FitnessePages/content.txt create mode 100644 TestXfhem/FitnessePages/properties.xml create mode 100755 xfhem/bin/xfhem create mode 100644 xfhem/etc/wagnertech.cfg diff --git a/TestXfhem/FitnessePages/TestWatchdog/.dummy b/TestXfhem/FitnessePages/TestWatchdog/.dummy new file mode 100644 index 0000000..e69de29 diff --git a/TestXfhem/FitnessePages/content.txt b/TestXfhem/FitnessePages/content.txt new file mode 100644 index 0000000..5f3d863 --- /dev/null +++ b/TestXfhem/FitnessePages/content.txt @@ -0,0 +1,2 @@ +#!contents -R2 -g -p -f -h +!contents diff --git a/TestXfhem/FitnessePages/properties.xml b/TestXfhem/FitnessePages/properties.xml new file mode 100644 index 0000000..72aa2b6 --- /dev/null +++ b/TestXfhem/FitnessePages/properties.xml @@ -0,0 +1,11 @@ + + + true + true + true + true + true + true + true + true + diff --git a/xfhem/bin/xfhem b/xfhem/bin/xfhem new file mode 100755 index 0000000..a1e6ad1 --- /dev/null +++ b/xfhem/bin/xfhem @@ -0,0 +1,51 @@ +#!/bin/bash + +usage="xfhem [define|delete] watchdog [SERVER]" + +PATH="/opt/fhem:$PATH" + +function process_watchdog { + server=$1 + case $operation in + define) + if [ -z "$server" ] + then + echo "SERVER required for define operation" + echo $usage + exit 1 + fi + fhem.pl 7072 "define watchdog at +*00:10:00 \"/usr/share/sysal/bin/triggerWatchdog_REST http://$server/sysal/rest rwd-$hostname $hostname\"" + ;; + delete) + fhem.pl 7072 "delete watchdog" + ;; + *) + echo "invalid operation $operation" + echo $usage + exit 1 + ;; + esac +} + +if [ $# -lt 2 ] +then + echo $usage + exit 1 +fi + +operation=$1 +object=$2 + +hostname=$(hostname) + +case $2 in +watchdog) + process_watchdog $3 + ;; +*) + echo "invalid object $2" + echo $usage + exit 1 + ;; +esac + diff --git a/xfhem/etc/wagnertech.cfg b/xfhem/etc/wagnertech.cfg new file mode 100644 index 0000000..386aab0 --- /dev/null +++ b/xfhem/etc/wagnertech.cfg @@ -0,0 +1,2 @@ +define telnetPort telnet 7072 + -- 2.20.1