#!/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