summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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