fathead
IS-IT--Management
- Apr 13, 2002
- 154
I need a script that will kill a process when a user logs in. This is the process that runs when they are running their software:
term2 25576 25557 0 Jan-30 ttya02 00:00:38 /u/dlcrt/bin/_progres lpgas -e 63 -p MAIN.P -o lpr -s -l 175
I want to kill this process if they login a second time. Users are closing the terminal emulator window before logging out causing licensing issues.
I am using the script below at another location, but I did not write it. I tried using this as a template but nothing worked.
Any help would be appreciated
whoami|tee usrfile
usr=`cat usrfile`
ps -no-heading -U $usr|grep rts|cut -c 1-5|tee testfile
num=`cat testfile`
kill -9 $num
# End of the runkillcp script
# Start CP now
cd /u/syn
./syn
term2 25576 25557 0 Jan-30 ttya02 00:00:38 /u/dlcrt/bin/_progres lpgas -e 63 -p MAIN.P -o lpr -s -l 175
I want to kill this process if they login a second time. Users are closing the terminal emulator window before logging out causing licensing issues.
I am using the script below at another location, but I did not write it. I tried using this as a template but nothing worked.
Any help would be appreciated
whoami|tee usrfile
usr=`cat usrfile`
ps -no-heading -U $usr|grep rts|cut -c 1-5|tee testfile
num=`cat testfile`
kill -9 $num
# End of the runkillcp script
# Start CP now
cd /u/syn
./syn