2 # Script to kill processes found running in the chroot.
4 if [ "${clst_chroot_path}" == "/" ]
6 echo "Aborting .... clst_chroot_path is set to /"
7 echo "This is very dangerous"
11 if [ "${clst_chroot_path}" == "" ]
13 echo "Aborting .... clst_chroot_path is NOT set"
14 echo "This is very dangerous"
20 # Get files and dirs in /proc
23 # Test for directories
26 # Search for exe containing string inside ${clst_chroot_path}
27 ls -la --color=never /proc/$i 2>&1 |grep exe|grep ${clst_chroot_path} > /dev/null
32 # Assign the pid into the pids array
42 echo "Killing process(es)"
43 echo "pid: process name"
46 P_NAME=$(ls -la --color=never /proc/${pid} 2>&1 |grep exe|grep ${clst_chroot_path}|awk '{print $11}')
47 echo ${pid}: ${P_NAME}
50 echo "Press Ctrl-C within 10 seconds to abort"
59 # Small sleep here to give the process(es) a chance to die before running unbind again.