#!/bin/bash IFS=$'\n' for i in `ps -e | grep backgroundview | tr -s " "` do echo $i | grep "^ " > /dev/null 2> /dev/null if [ $? == 0 ] then PID=`echo $i | cut -d " " -f 2` else PID=`echo $i | cut -d " " -f 1` fi kill -15 $PID done for i in `ps -e | grep mplayer | tr -s " "` do echo $i | grep "^ " > /dev/null 2> /dev/null if [ $? == 0 ] then PID=`echo $i | cut -d " " -f 2` else PID=`echo $i | cut -d " " -f 1` fi kill -15 $PID done for i in `ps -e | grep imageview | tr -s " "` do echo $i | grep "^ " > /dev/null 2> /dev/null if [ $? == 0 ] then PID=`echo $i | cut -d " " -f 2` else PID=`echo $i | cut -d " " -f 1` fi kill -15 $PID done ssh -t SAGE-stream-0 "/home/pcss/bin/killall" ssh -t SAGE-stream-1 "/home/pcss/bin/killall" ssh -t SAGE-stream-2 "/home/pcss/bin/killall" ssh -t SAGE-stream-3 "/home/pcss/bin/killall" ssh -t SAGE-stream-4 "/home/pcss/bin/killall"