UPS: apcupsd clean sources
[tomato.git] / release / src / router / apcupsd / platforms / darwin / ApcupsdDaemon.postflight
blob1f5edf804dccd5a340e7886172a325389b6e2010
1 #!/bin/sh
3 # Ensure kext cache is rebuilt
4 touch /System/Library/Extensions
6 if [ -f /etc/apcupsd/apcupsd.conf.SAVE ] ; then
7 # Appears to be an upgrade, so move user's original apcupsd.conf
8 # back into place and save new one as apcupsd.conf.new.
9 mv /etc/apcupsd/apcupsd.conf /etc/apcupsd/apcupsd.conf.new
10 mv /etc/apcupsd/apcupsd.conf.SAVE /etc/apcupsd/apcupsd.conf
11 else
12 # Looks like a new install, so open apcupsd.conf in an editor
13 # along with a message describing what to do.
14 open -t /etc/apcupsd/apcupsd.conf
15 echo "Please edit apcupsd.conf as appropriate for your UPS and save it before rebooting." > /tmp/inst.txt
16 open -t /tmp/inst.txt