nautilus/nautilus-clean.sh
Maciej Stachowiak e1dfd7e3ba Simple shell script to check if any of the auxiliary processes nautilus
* nautilus-clean.sh: Simple shell script to check if any of the
	auxiliary processes nautilus might launch are still running, and
	if so, report which ones and kill them. Total hack for dev/testing
        use only; should not be distributed.
2000-03-04 09:07:17 +00:00

36 lines
894 B
Bash
Executable file

#!/bin/sh
# This is a quick hack to check if any nautilus auxiliary processes
# are running, and if so, list them and kill them. It is not
# portable, and should be be expected to be used in any kind of
# production capacity.
# Add any new auxiliary programs here.
AUX_PROGS="hyperbola ntl-history-view ntl-notes ntl-web-search ntl-web-browser nautilus-sample-content-view bonobo-text-plain bonobo-image-generic gnome-vfs-slave";
unset FOUND_ANY;
for NAME in $AUX_PROGS; do
EGREP_PATTERN=`echo $NAME | sed -e 's/\(.\)\(.*\)/[\1]\2/' | sed -e 's/\[\\\^\]/\[\\^\]/'`;
COUNT=`ps auxww | egrep $EGREP_PATTERN | wc -l`;
if [ $COUNT -gt 0 ]; then
if [ -z $FOUND_ANY ]; then
echo "Stale Processes Found";
FOUND_ANY=true;
fi
echo "$NAME: $COUNT";
killall "$NAME";
fi
done
if [ -z $FOUND_ANY ]; then
echo "No Stale Processes Found";
exit 0;
fi
exit -1;