aboutsummaryrefslogtreecommitdiff
path: root/sysutils/munin-main/pkg-install
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2006-11-06 22:52:45 +0000
committerMartin Wilke <miwi@FreeBSD.org>2006-11-06 22:52:45 +0000
commitce0bf7c9ea07a82f4e5ed0f4da20e8c77f888790 (patch)
tree57146687564349154955ff2f1f4c1521332727a6 /sysutils/munin-main/pkg-install
parent2946e4e824c75a6f60cae2b39936845657c0b10d (diff)
Notes
Diffstat (limited to 'sysutils/munin-main/pkg-install')
-rw-r--r--sysutils/munin-main/pkg-install16
1 files changed, 13 insertions, 3 deletions
diff --git a/sysutils/munin-main/pkg-install b/sysutils/munin-main/pkg-install
index 3ce03edb2f51..e068113d3c43 100644
--- a/sysutils/munin-main/pkg-install
+++ b/sysutils/munin-main/pkg-install
@@ -5,7 +5,7 @@ ask() {
question=$1
default=$2
- if [ -z "${PACKAGE_BUILDING}" ]; then
+ if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
read -p "${question} [${default}]? " answer
fi
if [ x${answer} = x ]; then
@@ -97,21 +97,31 @@ EOT
fi
}
+move_www_dir() {
+ if [ -d ${PKG_PREFIX}/www/data/munin -a ! -d ${PKG_PREFIX}/www/munin ]; then
+ echo Migrating ${PKG_PREFIX}/www/data/munin to ${PKG_PREFIX}/www/munin
+ mv ${PKG_PREFIX}/www/data/munin ${PKG_PREFIX}/www/munin
+ fi
+}
+
########################################################################
case $2 in
PRE-INSTALL)
make_account munin munin "Munin owner"
+ move_www_dir # at some point in the installation, the www dir is created
;;
POST-INSTALL)
- newsyslog
- create_crontab_entries '#BEGIN_MUNIN_MAIN' '#END_MUNIN_MAIN' <<EOT
+ if [ -z "${PACKAGE_BUILDING}" ]; then
+ newsyslog
+ create_crontab_entries '#BEGIN_MUNIN_MAIN' '#END_MUNIN_MAIN' <<EOT
#BEGIN_MUNIN_MAIN
MAILTO=root
*/5 * * * * ${PKG_PREFIX}/bin/munin-cron
#END_MUNIN_MAIN
EOT
+ fi
;;
esac