diff --git a/sysutils/apcupsd/Makefile b/sysutils/apcupsd/Makefile index e8cbd0fcddd7..a561b0ea7d96 100644 --- a/sysutils/apcupsd/Makefile +++ b/sysutils/apcupsd/Makefile @@ -7,7 +7,7 @@ PORTNAME= apcupsd PORTVERSION= 3.10.15 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} @@ -100,6 +100,16 @@ post-install: ${INSTALL_SCRIPT} ${FILESDIR}/${STARTUP_SCRIPT} ${PREFIX}/etc/rc.d/${STARTUP_SCRIPT} ${INSTALL_DATA} ${FILESDIR}/apcupsd.conf.net-master.sample ${PREFIX}/etc/apcupsd/ ${INSTALL_DATA} ${FILESDIR}/apcupsd.conf.net-slave.sample ${PREFIX}/etc/apcupsd/ + # If there is already an config file it is installed as ...new + for na in apcupsd.conf apcupsd.css; do \ + if [ -f ${PREFIX}/etc/apcupsd/$$na ]; then \ + if [ -f ${PREFIX}/etc/apcupsd/$$na.new ]; then \ + ${MV} ${PREFIX}/etc/apcupsd/$$na.new ${PREFIX}/etc/apcupsd/$$na.sample; \ + else \ + ${CP} ${PREFIX}/etc/apcupsd/$$na ${PREFIX}/etc/apcupsd/$$na.sample; \ + fi; \ + fi; \ + done .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} diff --git a/sysutils/apcupsd/pkg-plist b/sysutils/apcupsd/pkg-plist index 9f6a5957aae5..d58e5c3149d6 100644 --- a/sysutils/apcupsd/pkg-plist +++ b/sysutils/apcupsd/pkg-plist @@ -5,6 +5,7 @@ sbin/apctest %%POWERFL%%sbin/powerflute etc/apcupsd/apcupsd.conf.net-master.sample etc/apcupsd/apcupsd.conf.net-slave.sample +etc/apcupsd/apcupsd.conf.sample etc/apcupsd/apccontrol etc/apcupsd/changeme etc/apcupsd/commfailure @@ -13,8 +14,7 @@ etc/apcupsd/mainsback etc/apcupsd/masterconnect etc/apcupsd/mastertimeout etc/apcupsd/onbattery -etc/apcupsd/apcupsd.conf.sample -%%CGI%%etc/apcupsd/cgi/apcupsd.css.sample +%%CGI%%etc/apcupsd/apcupsd.css.sample %%CGI%%etc/apcupsd/cgi/multimon.cgi %%CGI%%etc/apcupsd/cgi/upsfstats.cgi %%CGI%%etc/apcupsd/cgi/upsimage.cgi