From 3e7f9000c6868549b1b9cf8d447aa30bb54624f8 Mon Sep 17 00:00:00 2001 From: cos Date: Sat, 18 Jan 2014 12:05:00 +0100 Subject: Add initial config generation helper. --- generate_config | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 generate_config 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 -- cgit v1.2.3