summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcos <cos>2014-01-18 12:05:00 +0100
committercos <cos>2014-01-18 12:05:00 +0100
commit3e7f9000c6868549b1b9cf8d447aa30bb54624f8 (patch)
tree23c0f59c6bf54b65cbd9e5fc0c45c6f7e51d9df5
parent66dafbb3fbafe0458ba1167931bc04892ade2756 (diff)
downloadmat-3e7f9000c6868549b1b9cf8d447aa30bb54624f8.zip
Add initial config generation helper.
-rwxr-xr-xgenerate_config20
1 files changed, 20 insertions, 0 deletions
diff --git a/generate_config b/generate_config
new file mode 100755
index 0000000..2d46078
--- /dev/null
+++ b/generate_config
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+CONFIG_FILE_NAME=./config
+
+CONFIG="label_name `whoami`
+label_id_prefix https://`hostname --fqdn`/portion/"
+
+if [ -e "$CONFIG_FILE_NAME" ]
+then
+ echo "Not touching $CONFIG_FILE_NAME. It already exists." >/dev/stderr
+else
+ if echo "$CONFIG" > "$CONFIG_FILE_NAME"
+ then
+ echo "Config file created."
+ else
+ echo "Could not create $CONFIG_FILE_NAME." >/dev/stderr
+ fi
+fi