|
|
|
@ -338,14 +338,37 @@ do
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
limit_by_executable
|
|
|
|
|
num_watched_before="$(echo "$watched_pids" | wc -l)"
|
|
|
|
|
if [ -z "$watched_pids" ]
|
|
|
|
|
then
|
|
|
|
|
num_watched_before=0
|
|
|
|
|
else
|
|
|
|
|
num_watched_before="$(echo "$watched_pids" | wc -l)"
|
|
|
|
|
fi
|
|
|
|
|
limit_by_subprocess
|
|
|
|
|
num_watched_after="$(echo "$watched_pids" | wc -l)"
|
|
|
|
|
if [ -z "$watched_pids" ]
|
|
|
|
|
then
|
|
|
|
|
num_watched_after=0
|
|
|
|
|
else
|
|
|
|
|
num_watched_after="$(echo "$watched_pids" | wc -l)"
|
|
|
|
|
fi
|
|
|
|
|
if [ "$num_watched_before" -eq "$num_watched_after" ]
|
|
|
|
|
then
|
|
|
|
|
if [ "$watch_interval" = "0" ]
|
|
|
|
|
then
|
|
|
|
|
wait
|
|
|
|
|
if [ "$num_watched_after" -eq 0 ]
|
|
|
|
|
then
|
|
|
|
|
if [ -n "$verbose" ]
|
|
|
|
|
then
|
|
|
|
|
echo "No processes found, exiting. Specify --watch-interval to continue scanning for processes."
|
|
|
|
|
fi
|
|
|
|
|
exit
|
|
|
|
|
else
|
|
|
|
|
if [ -n "$verbose" ]
|
|
|
|
|
then
|
|
|
|
|
echo "Identified all processes to limit, waiting."
|
|
|
|
|
fi
|
|
|
|
|
wait
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
sleep "$watch_interval"
|
|
|
|
|
fi
|
|
|
|
|