aboutsummaryrefslogtreecommitdiff
path: root/refresh
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-04-21 14:20:40 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2018-04-21 14:20:40 +0200
commitf9d95f812b53fcb365522babe39d518b01a7b624 (patch)
tree4ce70660cfa8f146e11dfd153d83ec9a22dc01e0 /refresh
parenta1035c3f39c0952e09571be076bf6a4cb2fb966c (diff)
downloadiot-workshop-f9d95f812b53fcb365522babe39d518b01a7b624.tar.gz
iot-workshop-f9d95f812b53fcb365522babe39d518b01a7b624.tar.bz2
iot-workshop-f9d95f812b53fcb365522babe39d518b01a7b624.tar.xz
iot-workshop-f9d95f812b53fcb365522babe39d518b01a7b624.zip
wip
Diffstat (limited to 'refresh')
-rwxr-xr-xrefresh18
1 files changed, 18 insertions, 0 deletions
diff --git a/refresh b/refresh
new file mode 100755
index 0000000..eb12cb1
--- /dev/null
+++ b/refresh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -e
+
+file=$1
+key=$2
+value=$3
+
+if [[ -r $file ]]
+then
+ old=$(<"$file")
+fi
+
+if [[ $value != $old ]]
+then
+ echo $value > $file
+ echo Changed: $key
+fi