#! /bin/bash echo echo "Examining running StarSuite..." hosts="SunRayServer0 SunRayServer1 SunRayServer2 SunRayServer3" #hosts="localhost localhost localhost" myhost=`/usr/bin/hostname` for x in $hosts ; do echo echo "Sun Ray Server " $x command="/usr/bin/pgrep -l -u $LOGNAME soffice" if [ "$myhost" = "$x" ]; then echo $command $command a=`$command | /usr/bin/wc -l` else echo /usr/bin/rsh $x \"$command\" /usr/bin/rsh $x $command a=`/usr/bin/rsh $x $command | /usr/bin/wc -l` fi if [ $a -gt 0 ]; then h="$h $x" echo "$a StarSuite is (are) running on this server." else echo "No StarSuite is running on this server." fi done if [ "x$h" != "x" ]; then echo echo "Do you really want to forcedly terminate StarSuite?" echo " 1. Attempt to save unsaved documents and terminate StarSuite" echo " 2. Terminate StarSuite anyway" echo " 0. Cancel" while [ "x$signal" = "x" ]; do echo echo -n "What would you like? Answer with a number : " read answer case "$answer" in '1') signal="SEGV" ;; '2') signal="KILL" ;; '0') echo echo "Cancelled." echo echo -n "Press a Enter key to finish : " read answer exit 0 ;; *) ;; esac done for x in $h ; do echo echo "Server " $x command="/usr/bin/pkill -$signal -u $LOGNAME soffice.bin" if [ "$myhost" = "$x" ]; then echo $command $command else echo /usr/bin/rsh $x \"$command\" /usr/bin/rsh $x "$command" fi echo echo "Attempted to terminate StarSuite." done for x in starsuite7 starsuite8 ; do file="$HOME/$x/.lock" if [ -f $file ]; then echo echo "A lock file for avoiding unexpected overwriting exists." /usr/bin/rm -f $file echo echo "The lock file has been removed." fi done else echo "As a result, no StarSuite is running." fi echo echo -n "Press a Enter key to finish : " read answer exit 0