File: addsite

package info (click to toggle)
gup 0.5.13
  • links: PTS
  • area: main
  • in suites: lenny, squeeze, wheezy
  • size: 188 kB
  • ctags: 168
  • sloc: ansic: 1,609; sh: 213; makefile: 57
file content (28 lines) | stat: -rwxr-xr-x 443 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/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