#!/bin/sh

#
# tools/webCDcreatorRSA-installer.sh
#
# This file is part of webCDwriter - Network CD Writing.
#
# Copyright (C) 2002 Jörg P. M. Haeger
#
# webCDwriter is free software. See CDWserver.cpp for details.
#

# Thanks to Ramon Casha for the "Self-extracting Archive HOWTO"
# (see http://linux.org.mt/article/selfextract)

PRODUCT=webCDcreator.jar
PRODUCT2="(RSA signed version)"
VERSION=@VERSION@
DEST=/etc/CDWserver/webCDcreator/4pluginRSA

echo
echo "$PRODUCT $VERSION $PRODUCT2 Installer"
echo

if [ ! "`id -u`" = "0" ]; then
	echo "Restart as root!"
	exit 1
fi

echo -n "Installing $PRODUCT to $DEST/..."

SKIP=`awk '/^__ARCHIVE_FOLLOWS__/ { print NR + 1; exit 0; }' $0`

tail +$SKIP $0 | bzip2 -cd - > $DEST/$PRODUCT

echo "done"
echo

exit 0

__ARCHIVE_FOLLOWS__
