home *** CD-ROM | disk | FTP | other *** search
/ Intuitiv 3D / Intuitiv3D_1.img / CubXLicenseServer.pkg / CubXLicenseServer.post_install < prev    next >
Text File  |  1993-07-08  |  832b  |  39 lines

  1. #!/bin/sh
  2. #
  3. #
  4. PATH=/bin
  5. export PATH
  6.  
  7. INSTALLDIR=$2
  8.  
  9. grep CUBXLICENSE /etc/rc.local >/dev/null 2>/dev/null
  10.  
  11. case $? in
  12.     1 )    # delete very old rc.local.old
  13.         [ -f /etc/rc.local.old ] && rm -f /etc/rc.local.old
  14.  
  15.         # backup rc.local in rc.local.old
  16.         cp /etc/rc.local /etc/rc.local.old
  17.  
  18.         # add a line in rc.local
  19.         echo "## Start Cub'X license server CUBXLICENSE" >> /etc/rc.local
  20.         echo "[ -f $INSTALLDIR/CubX/CubXLicenseServer ] && $INSTALLDIR/CubX/CubXLicenseServer CUBXLICENSE &" >> /etc/rc.local
  21.         
  22.         # start server
  23.         $INSTALLDIR/CubX/CubXLicenseServer CUBXLICENSE > /dev/null 2> /dev/null < /dev/null &
  24.         
  25.         # done
  26.         echo "OK"
  27.         exit 0
  28.         ;;
  29.     2 ) # Error : cannot open /etc/rc.local
  30.         echo "FAILED (cannot open /etc/rc.local)"
  31.         exit 1
  32.         ;;
  33.     0 ) # Cub'X license already installed
  34.         echo "OK"
  35.         exit 0
  36.         ;;
  37. esac
  38. # not reachable...
  39.