start_vnc2.sh
==================================================================================
#!/bin/sh
#
# This script will start a VNC server in applmgrp's UID
#
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/bin:/usr/vacpp/bin:/DEV/appdev/scripts
export PATH
export DISPLAY=dev.global.to:2.0
unset LD_LIBRARY_PATH
unset LIBPATH
if [[ $USER = 'root' ]] # Check if user is root (should be applmgrp)
then
echo "\n# ERROR - Do not execute this script as root !!!"
echo "\n You should run \"su - appldev -c $0 instead\"\n"
exit
else
echo "\n Starting VNC server..."
/usr/bin/X11/vncserver :2 -nolisten local -httpd ${VNC}/classes -cc 3
echo " Check the process with ps -ef|grep vncserver\n"
fi
xhost +
===================================================================================
stop_vnc2.sh
===================================================================================
#!/bin/sh
#
# This script will stop the applmgrp VNC server
#
if [[ $USER = 'root' ]] # Check if user is root (should be applmgrp)
then
echo "\n# ERROR - Do not execute this script as root !!!"
echo "\n You should run \"su - appldev -c $0 instead\"\n"
exit
else
echo "\n Stopping VNC server..."
/usr/bin/X11/vncserver -kill :2
echo " VNC server killed - Check the process with ps -ef|grep vncserver\n"
fi
===================================================================================