#! /bin/csh -f

#
# do we have a GUI running ?  if so, ask user to kill it now
#
source scripts/aliases

warn_ui:
	set ps_fname = /tmp/fw.ui.pid.$$
	if ($solaris2) then
		/usr/bin/ps -ef > $ps_fname
	else if ($hpux) then
		/bin/ps -ef > $ps_fname
	else if ($freebsd) then
		/bin/ps ax > $ps_fname
	else
		/usr/bin/ps auxww > $ps_fname
	endif
	egrep 'fwui|fwlv' $ps_fname >& /dev/null
	if ($status == 0) then
		E " "
		E "It seems that $product User Interface processes"
		E "     are currently active on this machine:"
		head -1 $ps_fname
		egrep 'fwui|fwlv' $ps_fname
		E " "
		E "Please kill them now."
		E -n "Type 'ok' when you have killed them: "
		get aok
		if ("X$aok" != Xok) goto warn_ui
	endif
	/bin/rm $ps_fname
	exit 0
