home *** CD-ROM | disk | FTP | other *** search
/ chilidog.highland.cc.ks.us / chilidog.highland.cc.ks.us.zip / chilidog.highland.cc.ks.us / backup / bradford.20110725.etc.tar.gz / bradford.20110725.etc.tar / etc / init.d / boot.scpm < prev    next >
Text File  |  2006-05-02  |  2KB  |  69 lines

  1. #!/bin/sh
  2. #
  3. # Copyright (c) 2002 SuSE Linux AG, Nuernberg, Germany.
  4. #               2005 SUSE Linux Products GmbH
  5. #
  6. # Author: Joachim Gleissner <jg@suse.de>
  7. #
  8. # /etc/init.d/boot.scpm
  9. #
  10. # $Id: boot.scpm,v 1.3 2005/12/13 16:30:15 gleissner Exp $
  11. #
  12. ### BEGIN INIT INFO
  13. # Provides:          boot.scpm
  14. # Required-Start:    boot.localfs
  15. # X-UnitedLinux-ShouldStart: boot.md boot.lvm
  16. # Required-Stop:
  17. # Default-Start:     B
  18. # Default-Stop:
  19. # Description:       Set up on-boot profile
  20. ### END INIT INFO
  21.  
  22. . /etc/rc.status
  23.  
  24. SCPM=/usr/sbin/scpm
  25. SCPM_CONF=/etc/sysconfig/scpm
  26.  
  27. test -x $SCPM || exit 0
  28. test -f $SCPM_CONF || exit 0
  29.  
  30. . $SCPM_CONF
  31.  
  32. rc_reset
  33.  
  34. case "$1" in
  35.     start|b)
  36.     test -z "$PROFILE" && exit 0
  37.     test $($SCPM status | awk '{ if ($1 == "enabled") print $3 }') = no \
  38.         && { echo "Can not restore profile $PROFILE, SCPM is disabled" ;
  39.              exit 0; }
  40.     test "$PROFILE" = "`$SCPM active`" && exit 0
  41.     test -z "$BOOT_MODE" && BOOT_MODE=force
  42.     echo -n "Restoring profile $PROFILE"
  43.     if [ "$BOOT_MODE" = "force" ]; then
  44.         $SCPM -b -q -f switch $PROFILE || rc_failed
  45.     elif [ "$BOOT_MODE" = "skip" ]; then
  46.         $SCPM -b -q -s switch $PROFILE || rc_failed
  47.     elif [ "$BOOT_MODE" = "backup" ]; then
  48.         $SCPM -q delete _boot 2>/dev/null
  49.         $SCPM -q add _boot
  50.         $SCPM -b -q -s switch $PROFILE || rc_failed
  51.     else
  52.         echo -n "  unkown boot mode $BOOT_MODE"
  53.         rc_failed
  54.     fi
  55.     rc_status -v 
  56.     ;;
  57.     stop)
  58.     ;;
  59.     status)
  60.     rc_failed 4
  61.     rc_status -v
  62.     ;;
  63.     *)
  64.     echo "Usage: $0 {start|stop|status}"
  65.     exit 1
  66.     ;;
  67. esac
  68. rc_exit
  69.