epic-ts
authorMichael Wagner <michael@wagnertech.de>
Fri, 12 Apr 2019 22:20:59 +0000 (00:20 +0200)
committerMichael Wagner <michael@wagnertech.de>
Fri, 12 Apr 2019 22:20:59 +0000 (00:20 +0200)
TestXfhem/FitnessePages/TestWatchdog/.dummy [new file with mode: 0644]
TestXfhem/FitnessePages/content.txt [new file with mode: 0644]
TestXfhem/FitnessePages/properties.xml [new file with mode: 0644]
xfhem/bin/xfhem [new file with mode: 0755]
xfhem/etc/wagnertech.cfg [new file with mode: 0644]

diff --git a/TestXfhem/FitnessePages/TestWatchdog/.dummy b/TestXfhem/FitnessePages/TestWatchdog/.dummy
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/TestXfhem/FitnessePages/content.txt b/TestXfhem/FitnessePages/content.txt
new file mode 100644 (file)
index 0000000..5f3d863
--- /dev/null
@@ -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 (file)
index 0000000..72aa2b6
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<properties>
+       <Edit>true</Edit>
+       <Files>true</Files>
+       <Properties>true</Properties>
+       <RecentChanges>true</RecentChanges>
+       <Refactor>true</Refactor>
+       <Search>true</Search>
+       <Versions>true</Versions>
+       <WhereUsed>true</WhereUsed>
+</properties>
diff --git a/xfhem/bin/xfhem b/xfhem/bin/xfhem
new file mode 100755 (executable)
index 0000000..a1e6ad1
--- /dev/null
@@ -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 (file)
index 0000000..386aab0
--- /dev/null
@@ -0,0 +1,2 @@
+define telnetPort telnet 7072
+