#!/bin/sh
# The script to create initial Lopsus website content directory;
# Michael Pozhidaev <msp@altlinux.org>;

DATADIR='/usr/share/lopsus'

if [ "$1" == "--help" ]; then
cat <<EOF
Lopsus Init: The utility to create initial website content directory;

Usage:
    lopsus-init [--help] [DESTDIR]

if DESTDIR is omitted site content will be placed in current directory.
EOF
exit 0
fi

if [ -z "$1" ]; then
    DESTDIR="."
else
    DESTDIR="$(dirname "$1")/$(basename "$1")"
fi

set -e

/bin/mkdir -p "$DESTDIR"
/bin/cp -r $DATADIR/initial/* "$DESTDIR"
