summarylogtreecommitdiffstats
path: root/setwakeup.sh
diff options
context:
space:
mode:
authorManuel Reimer2018-12-25 16:55:23 +0100
committerManuel Reimer2018-12-25 16:55:23 +0100
commita4ecf2200d1a03df3dd13d3451d4eff0035e663e (patch)
tree558457f5ec451ab23dfa1a3183a0270357299206 /setwakeup.sh
downloadaur-a4ecf2200d1a03df3dd13d3451d4eff0035e663e.tar.gz
Sync from VDR4Arch (https://github.com/VDR4Arch/vdr4arch/commit/40c5e4ae6a68f79dc39eef2e47c4de0745b354d3)
Diffstat (limited to 'setwakeup.sh')
-rwxr-xr-xsetwakeup.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/setwakeup.sh b/setwakeup.sh
new file mode 100755
index 000000000000..4a66b4389016
--- /dev/null
+++ b/setwakeup.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+#Sync back system time to hardware time (Maybe VDR has changed it)
+hwclock --systohc --utc
+
+#Unset previous timer
+echo '0' > /sys/class/rtc/rtc0/wakealarm
+
+#Set new timer
+echo "$1" > /sys/class/rtc/rtc0/wakealarm
+
+#Log success to journal
+echo "Set wakeup time to timestamp $1" | logger -t kodi-setwakeup