#!/bin/sh # # Dry Contact UPS Device Driver Install Script # TMP=/tmp/ups.err ERROR1=" Errors have been written to the file $TMP." ERROR2=" The Dry Contact UPS Device Driver software was not installed, and the system has not been modified." echo "Installing Dry Contact UPS Device Driver Software Package" /etc/conf/bin/idcheck -p ups 2> $TMP if [ $? != 0 ] then message -cu "The Dry Contact UPS Device Driver is already installed (or partially installed). Do you wish to overwrite the existing device driver software?" if [ $? = 0 ] then /etc/conf/bin/idinstall -d ups else exit 1 fi fi # # Install the .h file before the build; Space.c needs a structure # definition contained therein. # cp ups.h /usr/include/sys chown bin /usr/include/sys/ups.h chgrp bin /usr/include/sys/ups.h chmod 444 /usr/include/sys/ups.h /etc/conf/bin/idinstall -a ups 2>> $TMP if [ $? != 0 ] then message "There was an error during package installation. $ERROR1 $ERROR2" exit 1 fi /etc/conf/bin/idbuild 2>> $TMP if [ $? != 0 ] then /etc/conf/bin/idinstall -d ups rm -f /usr/include/sys/ups.h message "There was an error during Kernel reconfiguration. $ERROR1 $ERROR2" exit 1 fi rm -f $TMP exit 0