cvs commit: hints/ATTACHMENTS/apcupsd-serial UPSdown apcupsd

tushar at linuxfromscratch.org tushar at linuxfromscratch.org
Thu Oct 30 06:45:11 PST 2003


tushar      03/10/30 07:45:11

  Added:       ATTACHMENTS/apcupsd-serial UPSdown apcupsd
  Log:
  Added attachments for apcupsd-serial
  
  Revision  Changes    Path
  1.1                  hints/ATTACHMENTS/apcupsd-serial/UPSdown
  
  Index: UPSdown
  ===================================================================
  #!/bin/sh
  # Begin /etc/rc.d/init.d/UPSdown
  #
  # Script to shutdown UPS after computer shutdown
  #
  # Written by John McSwain <jmcswain at infoave.net>
  #
  # Symlink in rc0.d after umounting filesystems
  #
  #
  # See if this is a powerfail situation
  if [ -f /etc/apcupsd/powerfail ]; then
          echo
          echo "APCUPSD will now power off the UPS"
          echo
          /etc/apcupsd/apccontrol killpower       
          echo
          echo "Verify the UPS shuts down or turn off the system"
          echo
  fi
  #
  # End /etc/rc.d/init.d/UPSdown
  
  
  
  1.1                  hints/ATTACHMENTS/apcupsd-serial/apcupsd
  
  Index: apcupsd
  ===================================================================
  #!/bin/sh
  # Begin $rc_base/init.d/apcupsd
  #
  # Boot script for apcupsd
  #
  # Written by John McSwain <jmcswain at infoave.net>
  # based on LFS scripts by Gerard Beekmans and
  # apcupsd scripts in apcupsd source package
  #
  # S20 in /etc/rc.d/rc{2,3,4,5}.d and K95 /etc/rc.d/rc1.d 
  #
  source /etc/sysconfig/rc
  source $rc_functions
  
  case "$1" in
          start)
                  # House keeping if this were a restart from powerfail
                  rm -f /etc/apcupsd/powerfail
                  rm -f /etc/nologin
                  # Start apcupsd
                  echo -n "Starting apcupsd power management ..."
                  loadproc /sbin/apcupsd
                  ;;
  
          stop)
                  echo -n "Stopping apcupsd power management..."
                  killproc /sbin/apcupsd
                  ;;
  
          restart)
                  $0 stop
                  sleep 1
                  $0 start
                  ;;
  
          *)
                  echo "Usage: $0 {start|stop|restart}"
                  exit 1
          ;;
  
  esac
  
  # End $rc_base/init.d/apcupsd
  
  
  



More information about the hints mailing list