#!/bin/bash

# This script is responsible for finding all the
# ibm5250 emulator processes that are started at the local hmc
# either by launch5250 or possibly by fastpath launch of 5250.
# These are processes that are ONLY started at the local HMC
# therefore this script should ONLY be called by termination
# processes that are executed as part of locally login off the HMC.

ibm5250pids=`/bin/ps -efwww | /usr/bin/grep -v grep | /usr/bin/grep ibm5250|cut -c10-15`
for i in $ibm5250pids
do
   if [ "$i" != "1" ]; then
      kill $i 2>/dev/null
   fi
done
exit 0
