home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / bin / sys5_idl_lmgrd < prev    next >
Encoding:
Text File  |  1997-07-08  |  2.7 KB  |  80 lines

  1. #!/bin/sh
  2. #
  3. #
  4. # This script can be used to start and stop the IDL network license
  5. # manager on System V operating systems. To use it, edit it to
  6. # customize it for your site. This is done by modifying the shell
  7. # variable definitions IDL_DIR, LM_LICENSE_FILE and LOG_FILE_NAME
  8. # shown below, if necessary.
  9. #
  10. # Once it is properly customized, use the following commands to install
  11. # it on your system. These commands assume that your current working
  12. # directory is the one containing this script.  Make sure to use the
  13. # appropriate commands for your system.
  14. #
  15. # Sun Solaris and SGI IRIX
  16. # ------------------------
  17. #    % cp sys5_idl_lmgrd /etc/init.d
  18. #    % ln /etc/init.d/sys5_idl_lmgrd /etc/rc2.d/S99sys5_idl_lmgrd
  19. #    % ln /etc/init.d/sys5_idl_lmgrd /etc/rc0.d/K01sys5_idl_lmgrd
  20. #
  21. # Alpha/OSF
  22. # ---------
  23. #    % cp sys5_idl_lmgrd /sbin/init.d
  24. #    % ln /sbin/init.d/sys5_idl_lmgrd /sbin/rc3.d/S99sys5_idl_lmgrd
  25. #    % ln /sbin/init.d/sys5_idl_lmgrd /sbin/rc0.d/K01sys5_idl_lmgrd
  26. #
  27. # After executing these commands, reboot the system.
  28. #
  29. # The following steps explain the commands above.
  30. #
  31. #    1) Copy this script to the standard System V location.
  32. #    2) Link it into the run level 2 directory (3 for Alpha OSF).
  33. #          The leading 'S' means that our daemon should be started
  34. #          at run level 2 (3 for Alpha OSF). The 99 causes this script
  35. #       to be executed after all other scripts in the rc directory.
  36. #    3) Link it into the run level 0 directory. The leading 'K' means
  37. #       that our daemon should be killed when entering run level 0.
  38. #       The 01 causes this script to be executed before the other scripts
  39. #       in /etc/rc0.d.
  40. #    4) Reboot the system, returning to multi-user mode. Entering this
  41. #       mode will cause the IDL license manager daemon to be started.
  42. #
  43. # TO LEARN MORE:
  44. #    - Read about run levels in the System Administration guide for
  45. #      your system.
  46. #    - Read the file /etc/init.d/README or /sbin/init.d/README or
  47. #         read the manual pages for init, rc0, rc2, and rc3.
  48.  
  49. # NOTE: EDIT THESE DEFINITIONS FOR YOUR SITE
  50. IDL_DIR=/usr/local/rsi/idl_4
  51. LM_LICENSE_FILE=$IDL_DIR/license.dat
  52. LOG_FILE_NAME="/dev/console"
  53. # END OF END-USER DEFINITIONS
  54.  
  55. SCRIPT=$0
  56. export IDL_DIR
  57. export LM_LICENSE_FILE
  58.  
  59.  
  60. # Make sure we really have the location of the daemon and the license file.
  61. if [ ! -f $IDL_DIR/bin/lmgrd ]; then
  62.   echo "$SCRIPT: Can't find the idl license manager daemon"
  63.   exit 1
  64. fi
  65. if [ ! -f $LM_LICENSE_FILE ]; then
  66.   echo "$SCRIPT: Can't find the idl license file: $LM_LICENSE_FILE"
  67.   exit 1
  68. fi
  69.  
  70. # Take the desired action
  71. case $1 in
  72.   "start") $IDL_DIR/bin/lmgrd > $LOG_FILE_NAME &
  73.            sleep 5  ;;
  74.   "stop")  $IDL_DIR/bin/lmdown -q ;;
  75.   *) echo "$SCRIPT: Unknown option: $1"
  76.      echo "Usage: $SCRIPT { start | stop }"
  77.      exit 1;;
  78. esac
  79.  
  80.