diff options
author | cos <cos> | 2014-01-18 12:05:00 +0100 |
---|---|---|
committer | cos <cos> | 2014-01-18 12:05:00 +0100 |
commit | 3e7f9000c6868549b1b9cf8d447aa30bb54624f8 (patch) | |
tree | 23c0f59c6bf54b65cbd9e5fc0c45c6f7e51d9df5 | |
parent | 66dafbb3fbafe0458ba1167931bc04892ade2756 (diff) | |
download | mat-3e7f9000c6868549b1b9cf8d447aa30bb54624f8.zip |
Add initial config generation helper.
-rwxr-xr-x | generate_config | 20 |
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 |