#!/bin/ksh # Fred Metry # Script takes a module from the PatDir directory and # copies it to ModDir directory. It backs up the old # module into the BakDir directory first. # # Run as root user with a Lawson environment # # Stoplaw before installing environment patches # You must download, untar and uncompress patches first # # Would help if program was 4777 to ensure permissions to copy # are acceptable # PatDir="" BakDir="" ModDir="" Mod="" echo "\nSetup for Patching ---All Arguments must be defined--- \n" while true ; do echo "Current Settings are:" echo "\t(1) Patch Source Directory = "$PatDir echo "\t(2) Backup Directory = "$BakDir echo "\t(3) Directory to Place Patch Module = "$ModDir echo "\t(4) Patch Module Name = "$Mod echo echo "Type Command Number 1,2,3,4,r(Run Program),e(Exit Program)" read Command case $Command in 1 ) echo "Type Patch Source Directory Name" read PatDir PatDir=$(eval echo $PatDir) ;; 2 ) echo "Type Backup Directory Name" read BakDir BakDir=$(eval echo $BakDir) ;; 3 ) echo "Type Directory Name to Place Patch" read ModDir ModDir=$(eval echo $ModDir) ;; 4 ) echo "Type Patch Module Name" read Mod Mod=$(eval echo $Mod) ;; r|R ) echo "Running Patch Backup and Replace Procedure" if [[ $PatDir = "" || $BakDir = "" || $ModDir = "" || $Mod = "" ]] ; then echo "\nERROR-One or more of the required parameters is not set, reruning setup." else # Back up old module into backup directory. cp -p $ModDir/$Mod $BakDir # Copy patch mod over original module. cp $PatDir/$Mod $ModDir fi echo "\n------------\nNext Patch?\n-------------" ;; e|E ) echo "Exiting Patch Installer" exit ;; * ) echo "ERROR-Invalid Choice Please Re-enter\n" ;; esac done