aboutsummaryrefslogtreecommitdiff
path: root/refresh
diff options
context:
space:
mode:
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