#!/bin/ksh -p
#
# ident "@(#)srss-shutdown.ksh	1.2	10/08/04 Oracle"
#
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
#
# srss-shutdown
#
# Description:
#   Stop Sunray daemon before installation/removal procedure
#
# Parameters:
#   (none)
#

typeset utprodinfo=/opt/SUNWut/lib/utprodinfo
typeset initd="/etc/init.d"
typeset -r xmgr=/etc/opt/SUNWut/xmgr

if [ -x $utprodinfo ] && $utprodinfo -t installed SUNWuto; then

    print "\nStopping Sun Ray services, please wait ..."
    [[ -x "${initd}/utsvc" ]] && ${initd}/utsvc stop 
    [[ -x "${initd}/utwadmin" ]] && ${initd}/utwadmin stop 
    [[ -x "${initd}/utstorage" ]] && ${initd}/utstorage stop
    [[ -x "${initd}/utds" ]] && ${initd}/utds stop 
    [[ -x "${initd}/utacleanup" ]] && ${initd}/utacleanup stop
    [[ -x "${xmgr}/reset-dpy" ]] && ${xmgr}/reset-dpy
    [[ -x "${xmgr}/notify" ]] && ${xmgr}/notify
fi

exit 0
