#!/bin/sh -e
# This script create the data files for a new site

gup=/var/lib/gup

# the username and group name that gup runs as
gup_uid=gup:news

if [ -z "$1" ]; then
  echo "Usage: gup: addsite [header [trailer]]"
  exit 1
fi

h=$1
header=$2
trailer=$3

cd $gup/sites
mkdir $h

if [ -n "$header" ]; then
  ln -s $gup/headers/$header $h/header
fi
if [ -n "$trailer" ]; then
  ln -s $gup/trailers/$trailer $h/trailer
fi
chown -R $gup_uid $h

