pkgsrc/sysutils/apcupsd/patches/patch-ai
bouyer 564268b946 Use a more up-to-date config file as example
Add rc.d keywords to the startup script
both suggested by Bernd Ernesti.
2007-06-15 21:15:38 +00:00

52 lines
2.2 KiB
Text

$NetBSD: patch-ai,v 1.4 2007/06/15 21:15:39 bouyer Exp $
--- platforms/netbsd/Makefile.in.orig 2007-06-15 22:58:26.000000000 +0200
+++ platforms/netbsd/Makefile.in 2007-06-15 22:59:03.000000000 +0200
@@ -21,47 +21,6 @@
# a previous version already existed.
#
install:
- @echo "NetBSD distribution installation"
- $(INSTALL_PROGRAM) -m 744 apcupsd /etc/rc.apcupsd
- @-today="`date +%Y%m%d%H%M`"; \
- grep -q '# TAG_APCUPSD' /etc/rc.shutdown; \
- if [ $$? -eq 0 ]; then \
- echo "/etc/rc.shutdown already patched"; \
- else \
- echo "patching /etc/rc.shutdown"; \
- rm -f /etc/rc.shutdown.$$today; \
- cp -p /etc/rc.shutdown /etc/rc.shutdown.$$today; \
- ( echo "# Do not remove the 'TAG_APCUPSD' text, below"; \
- echo "if [ -f @PWRFAILDIR@/powerfail ]; then # TAG_APCUPSD";\
- echo " powerdown=YES # TAG_APCUPSD"; \
- echo " echo '' # TAG_APCUPSD"; \
- echo " echo 'Please ensure that the UPS has powered off before' # TAG_APCUPSD"; \
- echo " echo 'rebooting. Otherwise, the UPS may cut the power' # TAG_APCUPSD"; \
- echo " echo 'during the reboot.' # TAG_APCUPSD"; \
- echo " echo '' # TAG_APCUPSD"; \
- echo "fi # TAG_APCUPSD"; \
- ) >> /etc/rc.shutdown; \
- fi; \
- grep -q /etc/rc.apcupsd /etc/rc.local; \
- if [ $$? -eq 0 ]; then \
- echo "/etc/rc.local already patched"; \
- else \
- rm -f /etc/rc.local.$$today; \
- cp -p /etc/rc.local /etc/rc.local.$$today; \
- ( echo "# Start the UPS daemon. Do not remove the 'TAG_APCUPSD' text"; \
- echo "# if [ -x /etc/rc.apcupsd ]; then # TAG_APCUPSD"; \
- echo "# /etc/rc.apcupsd start # TAG_APCUPSD"; \
- echo "# fi # TAG_APCUPSD"; \
- ) >> /etc/rc.local; \
- echo ""; \
- ( echo "While /etc/rc.local has been patched to run apcupsd,";\
- echo "the commands are currently commented out. You should"; \
- echo "examine the @sysconfdir@/apcupsd.conf file to ensure"; \
- echo "that it is suitable for your site. Then run"; \
- echo "/etc/rc.apcupsd manually to ensure sane operation."; \
- echo "Once you are satisfied, uncomment the appropriate"; \
- echo "lines in /etc/rc.local" ) | /usr/bin/fmt; \
- fi
uninstall:
@echo "NetBSD distribution uninstall"