Update of /cvsroot/devil-linux/build/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9239/scripts
Added Files:
apcupsd
Log Message:
initial checkin of apcupsd
--- NEW FILE: apcupsd ---
#!/bin/bash
# $Source: /cvsroot/devil-linux/build/scripts/apcupsd,v $
# $Revision: 1.1 $
# $Date: 2004/03/15 01:22:51 $
# http://www.devil-linux.org
# you need the next line, otherwise script won't be executed !!!
# DL-build-system v3
### BEGIN INIT INFO
# Provides: apcupsd
# Required-Start: $basebuildtools $libs
# Required-Stop:
# Default-Start: 1 2
# Default-Stop:
# Description: Daemon for APC UPS'es
### END INIT INFO
# get the directoryname of the script
MYDIR=${0%/*}
# source functions and config
source $MYDIR/settings
MYNAME=APCUPSD
case $1 in
build )
if [ "$CONFIG_APCUPSD" = "y" ]; then
CONFIG_OPTIONS=""
if [ "$CONFIG_HTTPD" = "y" ] || [ "$CONFIG_THTTPD" = "y" ]; then
CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-cgi --with-cgi-bin=/usr/share/apcupsd/cgi --with-css-dir=/usr/share/apcupsd/css"
else
CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-cgi"
fi
./configure --prefix=/usr --sbindir=/sbin --localstatedir=/var \
--sysconfdir=/etc/apcupsd \
--enable-net \
--enable-pthreads \
--enable-master-slave \
--enable-apcsmart \
--enable-dumb \
--enable-usb \
--enable-nis \
--enable-powerflute \
--with-serial-dev=/dev/usb/hiddev[0-15] \
--with-upstype=usb \
--with-upscable=usb \
$CONFIG_OPTIONS || exit 1
make $PMAKE all || exit 1
strip_debug
fi
;;
install )
if [ "$CONFIG_APCUPSD" = "y" ]; then
rm -rf $WORKDIR/tmp || exit 1
mkdir -p $WORKDIR/tmp/usr/share/apcupsd/{css,cgi} || exit 1
make install DESTDIR=$WORKDIR/tmp || exit 1
mkdir -p $ETCDIR/etc/apcupsd || exit 1
cp -dp $WORKDIR/tmp/etc/apcupsd/* $ETCDIR/etc/apcupsd/ || exit 1
copy_man $WORKDIR/tmp || exit 1
copy_files $WORKDIR/tmp/usr $CDDIR/ || exit 1
copy_files $WORKDIR/tmp/sbin $CDDIR/ || exit 1
rm -rf $WORKDIR/tmp || exit 1
cp -dp $MYDIR/scripts/apcupsd $ETCDIR/etc/init.d/ || exit 1
ln -sf /usr/share/apcupsd/cgi $ETCDIR/etc/apcupsd/cgi || exit 1
ln -sf /usr/share/apcupsd/css $ETCDIR/etc/apcupsd/css || exit 1
echo "# Start $MYNAME?" >> $CONFIGFILE
echo "START_$MYNAME=no" >> $CONFIGFILE
echo >> $CONFIGFILE
echo "HELP_$MYNAME=\"apcupsd monitors your APC UPS\"" >> $SOFTWAREHELP
fi
;;
* )
echo "ERROR ($0)"
echo "please add parameter so I know what to do"
exit 1
;;
esac
|