1999-01-26 19:22:28 -05:00
|
|
|
#!/bin/sh
|
2003-04-25 15:33:06 -04:00
|
|
|
# $OpenBSD: INSTALL,v 1.5 2003/04/25 19:33:06 sturm Exp $
|
1999-01-26 19:22:28 -05:00
|
|
|
#
|
|
|
|
# Pre/post-installation setup of amanda
|
|
|
|
|
|
|
|
set -e
|
|
|
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
2003-04-25 15:33:06 -04:00
|
|
|
PREFIX=${PKG_PREFIX:-/usr/local}
|
2001-05-12 12:41:08 -04:00
|
|
|
EXAMPLE_DIR=$PREFIX/share/examples/amanda
|
2003-04-25 15:33:06 -04:00
|
|
|
CONF_DIR=${SYSCONFDIR}/amanda
|
1999-01-26 19:22:28 -05:00
|
|
|
|
|
|
|
if [ $# -ne 2 ]; then
|
|
|
|
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# install the configuration files unless an existing configuration
|
|
|
|
# is found in which case warn the user that it may need to be
|
|
|
|
# updated.
|
|
|
|
#
|
|
|
|
do_configuration()
|
|
|
|
{
|
|
|
|
if [ ! -d ${EXAMPLE_DIR} ]; then
|
|
|
|
echo "-- Can't find configuration examples: ${EXAMPLE_DIR}" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
if [ -d ${CONF_DIR} ]; then
|
|
|
|
echo "** The directory ${CONF_DIR} exists. Your existing configuration"
|
|
|
|
echo "** files have not been changed. You MAY need to update your"
|
2000-03-06 20:57:50 -05:00
|
|
|
echo "** configuration. Please look at the directory"
|
2001-05-12 12:41:08 -04:00
|
|
|
echo "** ${EXAMPLE_DIR} and add any desired (but missing) entries into"
|
2000-03-06 20:57:50 -05:00
|
|
|
echo "** your current ${CONF_DIR}"
|
|
|
|
|
1999-01-26 19:22:28 -05:00
|
|
|
else
|
2001-05-12 12:41:08 -04:00
|
|
|
mkdir -p ${CONF_DIR}/csd
|
2000-03-06 20:57:50 -05:00
|
|
|
cp ${EXAMPLE_DIR}/amanda.conf ${CONF_DIR}/csd
|
2001-05-12 12:41:08 -04:00
|
|
|
cp ${EXAMPLE_DIR}/disklist ${CONF_DIR}/csd
|
1999-01-26 19:22:28 -05:00
|
|
|
echo "** The directory ${CONF_DIR} has been created with a sample"
|
|
|
|
echo "** configuration. You probably need to modify the files for"
|
|
|
|
echo "** your site."
|
|
|
|
fi
|
|
|
|
echo ""
|
|
|
|
echo "** See amanda(8) and the sample configuration files and INSTALL"
|
|
|
|
echo "** instructions in ${EXAMPLE_DIR} for more information"
|
|
|
|
}
|
|
|
|
|
|
|
|
# create the needed /var directories
|
|
|
|
#
|
|
|
|
do_var()
|
|
|
|
{
|
2001-05-12 12:41:08 -04:00
|
|
|
mkdir -p /var/amanda/gnutar-lists
|
2003-04-14 11:02:08 -04:00
|
|
|
chown -R operator:operator /var/amanda
|
1999-01-26 19:22:28 -05:00
|
|
|
}
|
|
|
|
|
2001-05-12 12:41:08 -04:00
|
|
|
# create the needed /etc/amandates file if it does not exist
|
|
|
|
# note that it is hardwired to be in /etc, not ${SYSCONFDIR}
|
1999-01-26 19:22:28 -05:00
|
|
|
#
|
2001-05-12 12:41:08 -04:00
|
|
|
do_amandates()
|
1999-01-26 19:22:28 -05:00
|
|
|
{
|
2001-05-12 12:41:08 -04:00
|
|
|
touch /etc/amandates
|
2003-04-14 11:02:08 -04:00
|
|
|
chown operator:operator /etc/amandates
|
1999-01-26 19:22:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
case $2 in
|
|
|
|
PRE-INSTALL)
|
|
|
|
: nothing to pre-install for this port
|
|
|
|
;;
|
|
|
|
POST-INSTALL)
|
|
|
|
do_configuration
|
2001-05-12 12:41:08 -04:00
|
|
|
do_var
|
|
|
|
do_amandates
|
1999-01-26 19:22:28 -05:00
|
|
|
echo ""
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|