home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #
- #
- # This script can be used to start and stop the IDL network license
- # manager on System V operating systems. To use it, edit it to
- # customize it for your site. This is done by modifying the shell
- # variable definitions IDL_DIR, LM_LICENSE_FILE and LOG_FILE_NAME
- # shown below, if necessary.
- #
- # Once it is properly customized, use the following commands to install
- # it on your system. These commands assume that your current working
- # directory is the one containing this script. Make sure to use the
- # appropriate commands for your system.
- #
- # Sun Solaris and SGI IRIX
- # ------------------------
- # % cp sys5_idl_lmgrd /etc/init.d
- # % ln /etc/init.d/sys5_idl_lmgrd /etc/rc2.d/S99sys5_idl_lmgrd
- # % ln /etc/init.d/sys5_idl_lmgrd /etc/rc0.d/K01sys5_idl_lmgrd
- #
- # Alpha/OSF
- # ---------
- # % cp sys5_idl_lmgrd /sbin/init.d
- # % ln /sbin/init.d/sys5_idl_lmgrd /sbin/rc3.d/S99sys5_idl_lmgrd
- # % ln /sbin/init.d/sys5_idl_lmgrd /sbin/rc0.d/K01sys5_idl_lmgrd
- #
- # After executing these commands, reboot the system.
- #
- # The following steps explain the commands above.
- #
- # 1) Copy this script to the standard System V location.
- # 2) Link it into the run level 2 directory (3 for Alpha OSF).
- # The leading 'S' means that our daemon should be started
- # at run level 2 (3 for Alpha OSF). The 99 causes this script
- # to be executed after all other scripts in the rc directory.
- # 3) Link it into the run level 0 directory. The leading 'K' means
- # that our daemon should be killed when entering run level 0.
- # The 01 causes this script to be executed before the other scripts
- # in /etc/rc0.d.
- # 4) Reboot the system, returning to multi-user mode. Entering this
- # mode will cause the IDL license manager daemon to be started.
- #
- # TO LEARN MORE:
- # - Read about run levels in the System Administration guide for
- # your system.
- # - Read the file /etc/init.d/README or /sbin/init.d/README or
- # read the manual pages for init, rc0, rc2, and rc3.
-
- # NOTE: EDIT THESE DEFINITIONS FOR YOUR SITE
- IDL_DIR=/usr/local/rsi/idl_4
- LM_LICENSE_FILE=$IDL_DIR/license.dat
- LOG_FILE_NAME="/dev/console"
- # END OF END-USER DEFINITIONS
-
- SCRIPT=$0
- export IDL_DIR
- export LM_LICENSE_FILE
-
-
- # Make sure we really have the location of the daemon and the license file.
- if [ ! -f $IDL_DIR/bin/lmgrd ]; then
- echo "$SCRIPT: Can't find the idl license manager daemon"
- exit 1
- fi
- if [ ! -f $LM_LICENSE_FILE ]; then
- echo "$SCRIPT: Can't find the idl license file: $LM_LICENSE_FILE"
- exit 1
- fi
-
- # Take the desired action
- case $1 in
- "start") $IDL_DIR/bin/lmgrd > $LOG_FILE_NAME &
- sleep 5 ;;
- "stop") $IDL_DIR/bin/lmdown -q ;;
- *) echo "$SCRIPT: Unknown option: $1"
- echo "Usage: $SCRIPT { start | stop }"
- exit 1;;
- esac
-
-