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.20101108.etc.tar.gz / bradford.20101108.etc.tar / etc / init.d / autoyast < prev    next >
Text File  |  2006-06-19  |  3KB  |  98 lines

  1. #! /bin/sh
  2. # Copyright (c) 1995-2004 SUSE Linux AG, Nuernberg, Germany.
  3. # All rights reserved.
  4. #
  5. # Author: Anas Nashif
  6. # Please send feedback to http://www.suse.de/feedback/
  7. #
  8. # /etc/init.d/autoyast
  9. #
  10. # LSB compatible service control script; see http://www.linuxbase.org/spec/
  11. #
  12. ### BEGIN INIT INFO
  13. # Provides:          autoyast
  14. # Required-Start:    $syslog $remote_fs $network
  15. # Should-Start: $time ypbind sendmail hwscan
  16. # Required-Stop:
  17. # Should-Stop:
  18. # Default-Start:     3 5
  19. # Default-Stop:      0 1 2 6
  20. # Short-Description: A start script to execute autoyast scripts
  21. # Description:       Execute autoyast scripts 
  22. ### END INIT INFO
  23.  
  24.  
  25. LOG_DIR="/var/adm/autoinstall/logs"
  26. SCRIPT_DIR="/var/adm/autoinstall/scripts"
  27. INITSCRIPT_DIR="/var/adm/autoinstall/init.d"
  28.  
  29. if [ ! -d "$INITSCRIPT_DIR" ]; then
  30.     exit 1
  31. fi
  32.  
  33. for script in  `find $INITSCRIPT_DIR -type f`; do
  34.     CONTINUE=1
  35. done
  36.  
  37. if [ -z "$CONTINUE" ]; then
  38.     exit 0
  39. fi
  40.  
  41. # Shell functions sourced from /etc/rc.status:
  42. #      rc_check         check and set local and overall rc status
  43. #      rc_status        check and set local and overall rc status
  44. #      rc_status -v     be verbose in local rc status and clear it afterwards
  45. #      rc_status -v -r  ditto and clear both the local and overall rc status
  46. #      rc_status -s     display "skipped" and exit with status 3
  47. #      rc_status -u     display "unused" and exit with status 3
  48. #      rc_failed        set local and overall rc status to failed
  49. #      rc_failed <num>  set local and overall rc status to <num>
  50. #      rc_reset         clear both the local and overall rc status
  51. #      rc_exit          exit appropriate to overall rc status
  52. #      rc_active        checks whether a service is activated by symlinks
  53. #      rc_splash arg    sets the boot splash screen to arg (if active)
  54. . /etc/rc.status
  55.  
  56. # Reset status of this service
  57. rc_reset
  58.  
  59. # Return values acc. to LSB for all commands but status:
  60. # 0      - success
  61. # 1       - generic or unspecified error
  62. # 2       - invalid or excess argument(s)
  63. # 3       - unimplemented feature (e.g. "reload")
  64. # 4       - user had insufficient privileges
  65. # 5       - program is not installed
  66. # 6       - program is not configured
  67. # 7       - program is not running
  68. # 8--199  - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
  69. # Note that starting an already running service, stopping
  70. # or restarting a not-running service as well as the restart
  71. # with force-reload (in case signaling is not supported) are
  72. # considered a success.
  73.  
  74.  
  75. case "$1" in
  76.     start)
  77.     # Remember status and be verbose
  78.         for script in  `find $INITSCRIPT_DIR -type f |sort`; do
  79.             echo -n "Executing AutoYaST script: $script"
  80.             BASENAME=`basename $script`
  81.             sh -x $script  2&> $LOG_DIR/$BASENAME.log
  82.             mv $script $SCRIPT_DIR
  83.         rc_status -v
  84.         done
  85.         chkconfig autoyast off
  86.     ;;
  87.     stop)
  88.         # Do nothing
  89.     ;;
  90.     *)
  91.     echo "Usage: $0 {start|stop}"
  92.     exit 1
  93.     ;;
  94. esac
  95. rc_exit
  96.