#!/bin/sh

#
# tools/webCDcreatorRSA-installer.sh
#
# This file is part of webCDwriter - Network CD Writing.
#
# Copyright (C) 2002-2003 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/http/webCDcreator/4pluginRSA

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

if [ ! "`id -u`" = "0" ]; then
	echo "This installer will replace $DEST/$PRODUCT."
	echo "To do so run it as root!"
	echo
	exit 1
fi

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

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

rm -f $DEST/$PRODUCT
rm -f $DEST/version-*
tail +$SKIP $0 | bzip2 -cd - > $DEST/$PRODUCT
touch $DEST/version-$VERSION

echo " done"
echo

exit 0

__ARCHIVE_FOLLOWS__
