#!/usr/bin/ksh ####################################################################3 # Unlock a previously locked environment # J. David Schronce Wed Sep 4 16:08:11 CDT 2002 ####################################################################3 # CONSTANTS WorkDir=/tmp STOPLAW=stoplaw STARTLAW=startlaw # Can only be run by root if [ `whoami` != "root" ]; then echo "$0 can only be run be root..." exit 1 fi # Make sure there is an environment if [ "X$LAWENVNAME" = "X" ]; then echo "\nNo Environment: . cv to SOURCE Environment...\n" exit 1 fi echo "\nNOTICE :Currently in * $LAWENVNAME * environment. If this is not the" echo "correct environment then press and cv to the correct one." echo "Otherwise, press to continue >\c" read dummy # See if Environment is running if [ `ps -ef | grep $LAWENVNAME | grep ladb | wc -l` -lt 2 ]; then echo "$LAWENVNAME Environment is not running..." exit 3 fi echo "\nThis program will restore the previous USERS file for access " echo "to $LAWENVNAME. It will stop and restart Lawson in the process" # Stop Env to clear USER data from cached memory $STOPLAW # Delete existing USER table and index rm $LADBDIR/GEN/USER rm $LADBDIR/GEN/USER.i # Start Env $STARTLAW echo "Restoring previous user list..." $GENDIR/importdb GEN USER $WorkDir/user.$LAWENVNAME.dmp # Cleanup rm $WorkDir/user.$LAWENVNAME.dmp rm $WorkDir/user.$LAWENVNAME.new