aboutsummaryrefslogtreecommitdiff
path: root/slides/refresh
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-04-24 09:23:08 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2018-04-24 09:23:08 +0200
commitf64b81fed9702c41af4cec14d91f38ce5ad3384e (patch)
tree63e91bbcd80c75f2239e7313284fcc9b1f42f22d /slides/refresh
parent83f6af8f26bd51844d5e83640e81d9d80dc467d4 (diff)
downloadiot-workshop-ndc-2018-f64b81fed9702c41af4cec14d91f38ce5ad3384e.tar.gz
iot-workshop-ndc-2018-f64b81fed9702c41af4cec14d91f38ce5ad3384e.tar.bz2
iot-workshop-ndc-2018-f64b81fed9702c41af4cec14d91f38ce5ad3384e.tar.xz
iot-workshop-ndc-2018-f64b81fed9702c41af4cec14d91f38ce5ad3384e.zip
o Moving everything under slides.
Diffstat (limited to 'slides/refresh')
-rwxr-xr-xslides/refresh18
1 files changed, 18 insertions, 0 deletions
diff --git a/slides/refresh b/slides/refresh
new file mode 100755
index 0000000..eb12cb1
--- /dev/null
+++ b/slides/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