Sametime: Unix Linux Startup Script: Difference between revisions

From Wiki
No edit summary
No edit summary
Line 15: Line 15:
You must check your installation path and profiles names
You must check your installation path and profiles names


== Current Version ==


  #! /bin/sh
  #! /bin/sh
Line 218: Line 219:
                 echo "Usage: $0 start|stop|restart|reload"
                 echo "Usage: $0 start|stop|restart|reload"
         exit 1
         exit 1
esac
exit 0
== Version 3.0 (BETA) ==
#! /bin/sh
# change this to #!/bin/ksh for AIX and Solaris
########################################################################
# chkconfig: 345 99 15
# description: IBM Lotus Sametime 8.5
### BEGIN INIT INFO
# Provides: rc_sametime
# Required-Start: $remote_fs $syslog$network
# Required-Stop:  $remote_fs $syslog
# Default-Start:  3 5
# Default-Stop:  0 1 2 6
# Short-Description: IBM Lotus Sametime Unix Script version 20100812.01
# Author: 2010 by Enio Basso ( http://ebasso.net ) 
# Copyright (C) 2010 Creative Commons
# License: GNU GPL v2 or (at your option) any later version.
### END INIT INFO
# Version info 20100812.01
########################################################################
SAMETIME_HOME=/opt/IBM/WebSphere/AppServer/profiles
USERNAME=wasadmin
PASSWORD=password
SAMETIME_HOME_SSC=$SAMETIME_HOME
SAMETIME_HOME_PROXY=$SAMETIME_HOME
SAMETIME_HOME_MEETING=$SAMETIME_HOME
SAMETIME_HOME_MEDIA=$SAMETIME_HOME
PROXY_DM_PROFILE=stproxyProxyDMProfile1
PROXY_PN_PROFILE=stproxyProxyPNProfile1
MEETING_DM_PROFILE=stmeetMeetingDMProfile1
MEETING_PN_PROFILE=stmeetMeetingPNProfile1
MEDIA_DM_PROFILE=stavMediaDMProfile1
MEDIA_PN_PROFILE=stavMediaPNProfile1
# Enable script debug output
if [ -z "$SCRIPT_DEBUG_MODE" ]; then
  #SCRIPT_DEBUG_MODE="no"
  SCRIPT_DEBUG_MODE="yes"
fi
# ------------ Helper Functions  -------------------------------------
DebugText ()
{
  if [ "$SCRIPT_DEBUG_MODE" = "yes" ]; then
    echo "Debug:" $1 $2 $3 $4 $5 $6 $7 $8 $9
  fi
  return 0
}
GetSystemArchitecture ()
{
  # Determine architecture and platform
  if [ `uname` = AIX ]; then
    LARCH=ibmpow
    PLATFORM_NAME=AIX
  elif [ `uname` = SunOS ]; then
    if [ `uname -p` = sparc ]; then
      LARCH=sunspa
      PLATFORM_NAME=Solaris
    else
      LARCH=sunx86
      PLATFORM_NAME=Solaris/x86
    fi
  elif [ `uname` = Linux ]; then
    LARCH=linux
    UNAME=`uname -m`
    if [ $UNAME = s390 ]; then
      PLATFORM_NAME=zLinux
    elif [ $UNAME = s390x ]; then
      PLATFORM_NAME=zLinux
    else
      PLATFORM_NAME=xLinux
    fi
 
    # Query linux distribution
    if [ ${LARCH} = "linux" ]; then
      if [ -e /etc/SuSE-release ]; then
        LINUX_DISTRIBUTION=suse
      elif [ -e /etc/redhat-release ]; then
        LINUX_DISTRIBUTION=redhat
      else
        LINUX_DISTRIBUTION=unknown
      fi
    fi
 
  fi
 
  if [ -z "$LARCH" ]; then
    echo "Unknown platform `uname`"
    exit 1
  fi
  return 0
}
 
usage ()
{
  echo ""
  echo "Usage: $0 start|stop|restart|reload"
  #echo "Usage: `basename $SCRIPT_NAME` { start | stop | restart | status | monitor | archivelog | cmd | stopjc}"
  #echo "Diagnostic Commands:    {info | nsd | fullnsd | memdump | hang | kill | cleanup }"
  echo ""
  return 0
}
start_ssc_deploy_manager ()
{
  # Sametime Deployment manager
  if [ -d "$SAMETIME_HOME_SSC/STSCDMgrProfile" ] ; then
    echo -n "Starting Deployment Manager: "
    $SAMETIME_HOME/STSCDMgrProfile/bin/startManager.sh
    echo "OK"
  else
      DebugText "ST SSC Deploy Mgmr home not available:" [$SAMETIME_HOME_SSC/STSCDMgrProfile]
  fi
  return 0
}
start_ssc_server ()
{
  # Sametime System Console Server
  if [ -d "$SAMETIME_HOME_SSC/STSCAppProfile" ] ; then
    echo -n "Starting Console Server NodeAgent: "
    $SAMETIME_HOME_SSC/STSCAppProfile/bin/startNode.sh
    echo "OK"
   
    echo -n "Starting Console Server: "
    $SAMETIME_HOME_SSC/STSCAppProfile/bin/startServer.sh STConsoleServer
    echo "OK"
  else
      DebugText "ST SSC home not available:" [$SAMETIME_HOME_SSC/STSCAppProfile]
  fi
  return 0
}
stop_ssc_deploy_manager ()
{
  # Sametime Deployment manager
  if [ -d "$SAMETIME_HOME_SSC/STSCDMgrProfile" ] ; then 
    echo -n "Stopping Deployment Manager: "
    $SAMETIME_HOME_SSC/STSCDMgrProfile/bin/stopManager.sh -username $USERNAME -password $PASSWORD
    echo "OK"
  else
      DebugText "ST SSC Deploy Mgmr home not available:" [$SAMETIME_HOME_SSC/STSCDMgrProfile]
  fi
  return 0
}
stop_ssc_server ()
{
  # Sametime System Console Server
  if [ -d "$SAMETIME_HOME_SSC/STSCAppProfile" ] ; then
    echo -n "Stopping Console Server: "
    $SAMETIME_HOME_SSC/STSCAppProfile/bin/stopServer.sh STConsoleServer -username $USERNAME -password $PASSWORD
    echo "OK"
   
    echo -n "Stopping Console Server NodeAgent: "
    $SAMETIME_HOME_SSC/STSCAppProfile/bin/stopNode.sh -username $USERNAME -password $PASSWORD
    echo "OK"
  else
      DebugText "ST SSC home not available:" [$SAMETIME_HOME_SSC/STSCAppProfile]
  fi
 
  return 0
}
start_proxy_deploy_manager ()
{
  # Sametime PROXY Server
  if [ -d "$SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE" ] ; then
    echo -n "Starting PROXY Server Manager: "
    $SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE/bin/startManager.sh
    echo "OK" 
  else
      DebugText "ST Proxy Server Deploy Mgmr home not available:" [$SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE]
  fi
  return 0
}
start_proxy_server ()
{
  # Sametime PROXY Server
  if [ -d "$SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE" ] ; then
    echo -n "Starting PROXY Server NodeAgent: "
    $SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE/bin/startNode.sh
    echo "OK"
    echo -n "Starting PROXY Server: "
    $SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE/bin/startServer.sh STProxyServer
    echo "OK"
  else
    DebugText "ST Proxy Server home not available:" [$SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE]
  fi
  return 0
}
stop_proxy_deploy_manager ()
{
  # Sametime PROXY Server
  if [ -d "$SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE" ] ; then
    echo -n "Stopping PROXY Server Manager: "
    $SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE/bin/stopManager.sh -username $USERNAME -password $PASSWORD
    echo "OK" 
  else
      DebugText "ST Proxy Server Deploy Mgmr home not available:" [$SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE]
  fi
 
  return 0
stop_proxy_server ()
{
  # Sametime PROXY Server
  if [ -d "$SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE" ] ; then
 
    echo -n "Stopping PROXY Server: "
    $SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE/bin/stopServer.sh STProxyServer -username $USERNAME -password $PASSWORD
    echo "OK"
    echo -n "Stopping PROXY Server NodeAgent: "
    $SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE/bin/stopNode.sh -username $USERNAME -password $PASSWORD
    echo "OK"
  else
    DebugText "ST Proxy Server home not available:" [$SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE]
  fi
 
  return 0
}
start_meeting_deploy_manager ()
{
  # Sametime MEETING Server
  if [ -d "$SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE" ] ; then
    echo -n "Starting MEETING Server Manager: "
    $SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE/bin/startManager.sh
    echo "OK"
  else
    DebugText "ST Meeting Server Deploy Mgmr home not available:" [$SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE]
  fi
  return 0
}
start_meeting_server ()
{
  # Sametime MEETING Server
  if [ -d "$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE" ] ; then
   
    echo -n "Starting MEETING Server NodeAgent: "
    $SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/startNode.sh
    echo "OK"
   
    echo -n "Starting MEETING Server: "
    $SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/startServer.sh STMeetingServer
    echo "OK"
   
    echo -n "Starting MEETING HttpProxy: "
    $SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/startServer.sh STMeetingHttpProxy
    echo "OK"
  else
    DebugText "ST Meeting Server home not available:" [$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE]
  fi
  return 0
}
stop_meeting_deploy_manager ()
{
  # Sametime MEETING Server
 
  if [ -d "$SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE" ] ; then
    echo -n "Stopping MEETING Server Manager: "
    $SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE/bin/stopManager.sh -username $USERNAME -password $PASSWORD
    echo "OK"
  else
    DebugText "ST Meeting Server Deploy Mgmr home not available:" [$SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE]
  fi
  return 0
}
stop_meeting_server ()
{
  # Sametime MEETING Server
  if [ -d "$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE" ] ; then
        echo -n "Stopping MEETING HttpProxy: "
        $SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/stopServer.sh STMeetingHttpProxy -username $USERNAME -password $PASSWORD
        echo "OK"
       
        echo -n "Stopping MEETING Server: "
        $SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/stopServer.sh STMeetingServer -username $USERNAME -password $PASSWORD
        echo "OK"
        echo -n "Stopping MEETING Server NodeAgent: "
        $SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/stopNode.sh -username $USERNAME -password $PASSWORD
        echo "OK"
  else
    DebugText "ST Meeting Server home not available:" [$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE]
  fi
         
  return 0
}
start_media_deploy_manager ()
{
  # Sametime MEDIA Server
  if [ -d "$SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE" ] ; then
    echo -n "Starting MEDIA Server Manager: "
    $SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE/bin/startManager.sh
    echo "OK"
  else
    DebugText "ST Media Server Deploy Mgmr home not available:" [$SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE]
  fi
  return 0
}
start_media_server ()
{
  # Sametime MEDIA Server
  if [ -d "$SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE" ] ; then
 
    echo -n "Starting MEDIA Server NodeAgent: "
    $SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE/bin/startNode.sh
    echo "OK"
 
    echo -n "Starting MEDIA Server: "
    $SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE/bin/startServer.sh STMediaServer
    echo "OK"
  else
    DebugText "ST Media Server home not available:" [$SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE]
  fi
  return 0
}
stop_media_deploy_manager ()
{
  # Sametime MEDIA Server
   
    if [ -d "$SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE" ] ; then
        echo -n "Stopping MEDIA Server Manager: "
        $SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE/bin/stopManager.sh -username $USERNAME -password $PASSWORD
        echo "OK"
    else
        DebugText "ST Media Server Deploy Mgmr home not available:" [$SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE]
    fi
  return 0
}
stop_media_server ()
{
  # Sametime MEDIA Server
  if [ -d "$SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE" ] ; then
    echo -n "Stopping MEDIA Server: "
    $SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE/bin/stopServer.sh STMediaServer -username $USERNAME -password $PASSWORD
    echo "OK"
   
    echo -n "Stopping MEDIA Server NodeAgent: "
    $SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE/bin/stopNode.sh -username $USERNAME -password $PASSWORD
    echo "OK"
  else
    DebugText "ST Media Server home not available:" [$SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE]
  fi 
  return 0
}
###########################################################  Main Script ##############################################################3
# Determine architecture and platform
#GetSystemArchitecture
#echo $PLATFORM_NAME
# --- Sanity check for server environment ---
case "$1" in
  start)
      # Sametime Deployment manager
      start_ssc_deploy_manager
     
      # Sametime System Console Server
      start_ssc_server
      # Sametime PROXY Server Deploy Manager
      start_proxy_deploy_manager
      # Sametime PROXY Server
      start_proxy_server
      # Sametime MEETING Server Deploy Manager
      start_meeting_deploy_manager
      # Sametime MEETING Server
      start_meeting_server
      # Sametime MEDIA Deploy Manager
      start_media_deploy_manager
      # Sametime MEDIA Server
      start_media_server               
  ;;
  stop)
      # Sametime MEDIA Server
      stop_media_server
      # Sametime MEDIA Deploy Manager
      stop_media_deploy_manager
      # Sametime MEETING Server
      stop_meeting_server
      # Sametime MEETING Server Deploy Manager
      stop_meeting_deploy_manager
      # Sametime PROXY Server
      stop_proxy_server
      # Sametime PROXY Server Deploy Manager
      stop_proxy_deploy_manager
      # Sametime System Console Server
      stop_ssc_server
      # Sametime Deployment manager
      stop_ssc_deploy_manager
     
  ;;
  reload|restart)
    $0 stop
    $0 start
  ;;
  *)
    DebugText "Invalid PARAM:" [$PARAM]
    usage
    exit 1
  ;;
  esac
  esac
  exit 0
  exit 0

Revision as of 18:07, 12 August 2010

This Script is for Sametime 8.5

  • Meeting Server
  • Proxy Server
  • Media Server
  • Solution Console

for Community/Classic Meeting you can use script from NashCon Domino for Unix/Linux Start-Script

You can use if you install Sametime 8.5 in a single box or on multiple box.

  1. Create a file /etc/init.d/rc_sametime and put the text below and save
  2. run > chkconfig --add /etc/init.d/rc_sametime

You must check your installation path and profiles names

Current Version

#! /bin/sh
########################################################################
# chkconfig: 345 99 15
# description: IBM Lotus Sametime 8.5

### BEGIN INIT INFO
# Provides: rc_sametime
# Required-Start: $remote_fs $syslog$network
# Required-Stop:  $remote_fs $syslog
# Default-Start:  3 5
# Default-Stop:   0 1 2 6
# Short-Description: IBM Lotus Sametime Unix Script version 20100511.01
# Author: 2010 by Enio Basso ( http://ebasso.net )
# Copyright (C) 2010 Creative Commons
# License: GNU GPL v2 or (at your option) any later version.
### END INIT INFO

########################################################################

SAMETIME_HOME=/opt/IBM/WebSphere/AppServer/profiles
USERNAME=wasadmin
PASSWORD=passwd

SAMETIME_HOME_SSC=$SAMETIME_HOME
SAMETIME_HOME_PROXY=$SAMETIME_HOME
SAMETIME_HOME_MEETING=$SAMETIME_HOME
SAMETIME_HOME_MEDIA=$SAMETIME_HOME

PROXY_DM_PROFILE=stproxyProxyDMProfile1
PROXY_PN_PROFILE=stproxyProxyPNProfile1
MEETING_DM_PROFILE=stmeetMeetingDMProfile1
MEETING_PN_PROFILE=stmeetMeetingPNProfile1
MEDIA_DM_PROFILE=stavMediaDMProfile1
MEDIA_PN_PROFILE=stavMediaPNProfile1 

case "$1" in
         start) 
		# Sametime Deployment manager
		if [ -d "$SAMETIME_HOME_SSC/STSCDMgrProfile" ] ; then
               	echo -n "Starting Deployment Manager: "
	   		$SAMETIME_HOME_SSC/STSCDMgrProfile/bin/startManager.sh
			echo "OK"
		fi

		# Sametime System Console Server
		if [ -d "$SAMETIME_HOME_SSC/STSCAppProfile" ] ; then
                	echo -n "Starting Console Server NodeAgent: "
	   		$SAMETIME_HOME_SSC/STSCAppProfile/bin/startNode.sh
	                echo "OK"

	                echo -n "Starting Console Server: "
	   		$SAMETIME_HOME_SSC/STSCAppProfile/bin/startServer.sh STConsoleServer
	                echo "OK"
		fi

		# Sametime PROXY Server
		if [ -d "$SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE" ] ; then
	                echo -n "Starting PROXY Server Manager: "
  			$SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE/bin/startManager.sh
			echo "OK"
		fi

		if [ -d "$SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE" ] ; then

       	        echo -n "Starting PROXY Server NodeAgent: "
  			$SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE/bin/startNode.sh
        	        echo "OK"

	                echo -n "Starting PROXY Server: "
	   		$SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE/bin/startServer.sh STProxyServer
	                echo "OK"
		fi

		# Sametime MEETING Server
       	if [ -d "$SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE" ] ; then
	                echo -n "Starting MEETING Server Manager: "
	   		$SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE/bin/startManager.sh
			echo "OK"
		fi

             	if [ -d "$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE" ] ; then

	                echo -n "Starting MEETING Server NodeAgent: "
	   		$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/startNode.sh
	                echo "OK"
	
	                echo -n "Starting MEETING Server: "
	   		$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/startServer.sh STMeetingServer
	                echo "OK"

	                echo -n "Starting MEETING HttpProxy: "
	   		$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/startServer.sh STMeetingHttpProxy
	                echo "OK"
		fi

               # Sametime MEDIA Server
               if [ -d "$SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE" ] ; then
                       echo -n "Starting MEDIA Server Manager: "
                       $SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE/bin/startManager.sh
                       echo "OK"
               fi

               if [ -d "$SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE" ] ; then

                       echo -n "Starting MEDIA Server NodeAgent: "
                       $SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE/bin/startNode.sh
                       echo "OK"

                       echo -n "Starting MEDIA Server: "
                       $SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE/bin/startServer.sh STMediaServer
                       echo "OK"
               fi

       ;;
       stop)

               # Sametime MEDIA Server
               if [ -d "$SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE" ] ; then

                       echo -n "Stopping MEDIA Server: "
                       $SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE/bin/stopServer.sh STMediaServer -username $USERNAME -password $PASSWORD
                       echo "OK"

                       echo -n "Stopping MEDIA Server NodeAgent: "
                       $SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE/bin/stopNode.sh -username $USERNAME -password $PASSWORD
                       echo "OK"
               fi

               if [ -d "$SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE" ] ; then
                       echo -n "Stopping MEDIA Server Manager: "
                       $SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE/bin/stopManager.sh -username $USERNAME -password $PASSWORD
                       echo "OK"
               fi

              # Sametime MEETING Server
              if [ -d "$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE" ] ; then
		
               	echo -n "Stopping MEETING HttpProxy: "
  			$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/stopServer.sh STMeetingHttpProxy -username $USERNAME -password $PASSWORD
               	echo "OK"

	                echo -n "Stopping MEETING Server: "
  			$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/stopServer.sh STMeetingServer -username $USERNAME -password $PASSWORD
        	        echo "OK"

       	        echo -n "Stopping MEETING Server NodeAgent: "
  			$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/stopNode.sh -username $USERNAME -password $PASSWORD
       	        echo "OK"
		
		fi
       	if [ -d "$SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE" ] ; then
	        	echo -n "Stopping MEETING Server Manager: "
  			$SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE/bin/stopManager.sh -username $USERNAME -password $PASSWORD
			echo "OK"
		fi

		# Sametime PROXY Server
		if [ -d "$SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE" ] ; then

	                echo -n "Stopping PROXY Server: "
	   		$SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE/bin/stopServer.sh STProxyServer -username $USERNAME -password $PASSWORD
	                echo "OK"
	
	                echo -n "Stopping PROXY Server NodeAgent: "
	   		$SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE/bin/stopNode.sh -username $USERNAME -password $PASSWORD
	                echo "OK"
		fi

		if [ -d "$SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE" ] ; then
	                echo -n "Stopping PROXY Server Manager: "
	   		$SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE/bin/stopManager.sh -username $USERNAME -password $PASSWORD
			echo "OK"
		fi

		# Sametime System Console Server
		if [ -d "$SAMETIME_HOME_SSC/STSCAppProfile" ] ; then

	                echo -n "Stopping Console Server: "
	   		$SAMETIME_HOME_SSC/STSCAppProfile/bin/stopServer.sh STConsoleServer -username $USERNAME -password $PASSWORD
	                echo "OK"

	                echo -n "Stopping Console Server NodeAgent: "
	   		$SAMETIME_HOME_SSC/STSCAppProfile/bin/stopNode.sh -username $USERNAME -password $PASSWORD
	                echo "OK"
		fi

		# Sametime Deployment manager
		if [ -d "$SAMETIME_HOME_SSC/STSCDMgrProfile" ] ; then

 	                echo -n "Stopping Deployment Manager: " 
	   		$SAMETIME_HOME_SSC/STSCDMgrProfile/bin/stopManager.sh -username $USERNAME -password $PASSWORD
			echo "OK"
		fi

        ;;
        reload|restart)
                $0 stop
                $0 start
        ;;
        *)
                echo "Usage: $0 start|stop|restart|reload"
        exit 1
esac
exit 0

Version 3.0 (BETA)

#! /bin/sh
# change this to #!/bin/ksh for AIX and Solaris
########################################################################
# chkconfig: 345 99 15
# description: IBM Lotus Sametime 8.5

### BEGIN INIT INFO
# Provides: rc_sametime
# Required-Start: $remote_fs $syslog$network
# Required-Stop:  $remote_fs $syslog
# Default-Start:  3 5
# Default-Stop:   0 1 2 6
# Short-Description: IBM Lotus Sametime Unix Script version 20100812.01
# Author: 2010 by Enio Basso ( http://ebasso.net )  
# Copyright (C) 2010 Creative Commons
# License: GNU GPL v2 or (at your option) any later version.
### END INIT INFO

# Version info 20100812.01
######################################################################## 

SAMETIME_HOME=/opt/IBM/WebSphere/AppServer/profiles
USERNAME=wasadmin
PASSWORD=password

SAMETIME_HOME_SSC=$SAMETIME_HOME
SAMETIME_HOME_PROXY=$SAMETIME_HOME
SAMETIME_HOME_MEETING=$SAMETIME_HOME
SAMETIME_HOME_MEDIA=$SAMETIME_HOME 

PROXY_DM_PROFILE=stproxyProxyDMProfile1
PROXY_PN_PROFILE=stproxyProxyPNProfile1
MEETING_DM_PROFILE=stmeetMeetingDMProfile1
MEETING_PN_PROFILE=stmeetMeetingPNProfile1
MEDIA_DM_PROFILE=stavMediaDMProfile1
MEDIA_PN_PROFILE=stavMediaPNProfile1 

# Enable script debug output
if [ -z "$SCRIPT_DEBUG_MODE" ]; then
 #SCRIPT_DEBUG_MODE="no"
 SCRIPT_DEBUG_MODE="yes"
fi

# ------------ Helper Functions   -------------------------------------
DebugText ()
{
 if [ "$SCRIPT_DEBUG_MODE" = "yes" ]; then
   echo "Debug:" $1 $2 $3 $4 $5 $6 $7 $8 $9
 fi

 return 0
}

GetSystemArchitecture ()
{
 # Determine architecture and platform
 if [ `uname` = AIX ]; then
   LARCH=ibmpow
   PLATFORM_NAME=AIX
 elif [ `uname` = SunOS ]; then
   if [ `uname -p` = sparc ]; then
     LARCH=sunspa
     PLATFORM_NAME=Solaris
   else
     LARCH=sunx86
     PLATFORM_NAME=Solaris/x86
   fi
 elif [ `uname` = Linux ]; then
   LARCH=linux
   UNAME=`uname -m`
   if [ $UNAME = s390 ]; then
     PLATFORM_NAME=zLinux
   elif [ $UNAME = s390x ]; then
     PLATFORM_NAME=zLinux
   else
     PLATFORM_NAME=xLinux
   fi
 
   # Query linux distribution
   if [ ${LARCH} = "linux" ]; then
     if [ -e /etc/SuSE-release ]; then
       LINUX_DISTRIBUTION=suse
     elif [ -e /etc/redhat-release ]; then
       LINUX_DISTRIBUTION=redhat
     else
       LINUX_DISTRIBUTION=unknown
     fi
   fi
 
 fi
 
 if [ -z "$LARCH" ]; then
   echo "Unknown platform `uname`"
   exit 1
 fi

 return 0
}
 
usage ()
{
 echo ""
 echo "Usage: $0 start|stop|restart|reload"
 #echo "Usage: `basename $SCRIPT_NAME` { start | stop | restart | status | monitor | archivelog | cmd | stopjc}"
 #echo "Diagnostic Commands:    {info | nsd | fullnsd | memdump | hang | kill | cleanup }"
 echo ""

 return 0
}

start_ssc_deploy_manager ()
{
 # Sametime Deployment manager
 if [ -d "$SAMETIME_HOME_SSC/STSCDMgrProfile" ] ; then
    echo -n "Starting Deployment Manager: "
    $SAMETIME_HOME/STSCDMgrProfile/bin/startManager.sh
    echo "OK"
 else
      DebugText "ST SSC Deploy Mgmr home not available:" [$SAMETIME_HOME_SSC/STSCDMgrProfile]
 fi

 return 0
}

start_ssc_server ()
{
 # Sametime System Console Server
 if [ -d "$SAMETIME_HOME_SSC/STSCAppProfile" ] ; then
    echo -n "Starting Console Server NodeAgent: "
    $SAMETIME_HOME_SSC/STSCAppProfile/bin/startNode.sh
    echo "OK"
    
    echo -n "Starting Console Server: "
    $SAMETIME_HOME_SSC/STSCAppProfile/bin/startServer.sh STConsoleServer
    echo "OK"
 else
      DebugText "ST SSC home not available:" [$SAMETIME_HOME_SSC/STSCAppProfile]
 fi

 return 0
}

stop_ssc_deploy_manager ()
{
 # Sametime Deployment manager
 if [ -d "$SAMETIME_HOME_SSC/STSCDMgrProfile" ] ; then   
    echo -n "Stopping Deployment Manager: "
    $SAMETIME_HOME_SSC/STSCDMgrProfile/bin/stopManager.sh -username $USERNAME -password $PASSWORD
    echo "OK"
 else
      DebugText "ST SSC Deploy Mgmr home not available:" [$SAMETIME_HOME_SSC/STSCDMgrProfile]
 fi 

 return 0
}

stop_ssc_server ()
{
 # Sametime System Console Server
 if [ -d "$SAMETIME_HOME_SSC/STSCAppProfile" ] ; then
    echo -n "Stopping Console Server: "
    $SAMETIME_HOME_SSC/STSCAppProfile/bin/stopServer.sh STConsoleServer -username $USERNAME -password $PASSWORD
    echo "OK"
    
    echo -n "Stopping Console Server NodeAgent: "
    $SAMETIME_HOME_SSC/STSCAppProfile/bin/stopNode.sh -username $USERNAME -password $PASSWORD
    echo "OK"
 else
      DebugText "ST SSC home not available:" [$SAMETIME_HOME_SSC/STSCAppProfile]
 fi
 
 return 0
}


start_proxy_deploy_manager ()
{
 # Sametime PROXY Server
 if [ -d "$SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE" ] ; then
    echo -n "Starting PROXY Server Manager: "
    $SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE/bin/startManager.sh
    echo "OK"  
 else
      DebugText "ST Proxy Server Deploy Mgmr home not available:" [$SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE]
 fi

 return 0
}

start_proxy_server ()
{
 # Sametime PROXY Server
 if [ -d "$SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE" ] ; then
    echo -n "Starting PROXY Server NodeAgent: "
    $SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE/bin/startNode.sh
    echo "OK"

    echo -n "Starting PROXY Server: "
    $SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE/bin/startServer.sh STProxyServer
    echo "OK"
 else
    DebugText "ST Proxy Server home not available:" [$SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE]
 fi

 return 0
}

stop_proxy_deploy_manager ()
{
 # Sametime PROXY Server
 if [ -d "$SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE" ] ; then
    echo -n "Stopping PROXY Server Manager: "
    $SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE/bin/stopManager.sh -username $USERNAME -password $PASSWORD
    echo "OK"  
 else
      DebugText "ST Proxy Server Deploy Mgmr home not available:" [$SAMETIME_HOME_PROXY/$PROXY_DM_PROFILE]
 fi
 
 return 0
}  

stop_proxy_server ()
{
 # Sametime PROXY Server
 if [ -d "$SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE" ] ; then
 
    echo -n "Stopping PROXY Server: "
    $SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE/bin/stopServer.sh STProxyServer -username $USERNAME -password $PASSWORD
    echo "OK"
	
    echo -n "Stopping PROXY Server NodeAgent: "
    $SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE/bin/stopNode.sh -username $USERNAME -password $PASSWORD
    echo "OK"
 else
    DebugText "ST Proxy Server home not available:" [$SAMETIME_HOME_PROXY/$PROXY_PN_PROFILE]
 fi
 
 return 0
}

start_meeting_deploy_manager ()
{
 # Sametime MEETING Server
 if [ -d "$SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE" ] ; then
    echo -n "Starting MEETING Server Manager: "
    $SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE/bin/startManager.sh
    echo "OK"
 else
    DebugText "ST Meeting Server Deploy Mgmr home not available:" [$SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE]
 fi

 return 0
}

start_meeting_server ()
{
 # Sametime MEETING Server
 if [ -d "$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE" ] ; then
    
    echo -n "Starting MEETING Server NodeAgent: "
    $SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/startNode.sh
    echo "OK"
    	
    echo -n "Starting MEETING Server: "
    $SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/startServer.sh STMeetingServer
    echo "OK"
    
    echo -n "Starting MEETING HttpProxy: "
    $SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/startServer.sh STMeetingHttpProxy
    echo "OK"
 else
    DebugText "ST Meeting Server home not available:" [$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE]
  fi

 return 0
}

stop_meeting_deploy_manager ()
{
 # Sametime MEETING Server
 
 if [ -d "$SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE" ] ; then
    echo -n "Stopping MEETING Server Manager: "
    $SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE/bin/stopManager.sh -username $USERNAME -password $PASSWORD
    echo "OK"
 else
    DebugText "ST Meeting Server Deploy Mgmr home not available:" [$SAMETIME_HOME_MEETING/$MEETING_DM_PROFILE]
 fi

 return 0
}

stop_meeting_server ()
{
 # Sametime MEETING Server

  if [ -d "$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE" ] ; then
		
       echo -n "Stopping MEETING HttpProxy: "
       $SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/stopServer.sh STMeetingHttpProxy -username $USERNAME -password $PASSWORD
       echo "OK"
       
       echo -n "Stopping MEETING Server: "
       $SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/stopServer.sh STMeetingServer -username $USERNAME -password $PASSWORD
       echo "OK"

       echo -n "Stopping MEETING Server NodeAgent: "
       $SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE/bin/stopNode.sh -username $USERNAME -password $PASSWORD
       echo "OK"	
 else
    DebugText "ST Meeting Server home not available:" [$SAMETIME_HOME_MEETING/$MEETING_PN_PROFILE]
 fi
          
 return 0
}

start_media_deploy_manager ()
{
 # Sametime MEDIA Server 
 if [ -d "$SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE" ] ; then
    echo -n "Starting MEDIA Server Manager: "
    $SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE/bin/startManager.sh
    echo "OK"
 else
    DebugText "ST Media Server Deploy Mgmr home not available:" [$SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE]
 fi

 return 0
}

start_media_server ()
{
 # Sametime MEDIA Server 
 if [ -d "$SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE" ] ; then
 
   echo -n "Starting MEDIA Server NodeAgent: "
   $SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE/bin/startNode.sh
   echo "OK"
 
   echo -n "Starting MEDIA Server: "
   $SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE/bin/startServer.sh STMediaServer
   echo "OK"
 else
    DebugText "ST Media Server home not available:" [$SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE]
 fi

 return 0
}

stop_media_deploy_manager ()
{
 # Sametime MEDIA Server 
    
    if [ -d "$SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE" ] ; then
       echo -n "Stopping MEDIA Server Manager: "
       $SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE/bin/stopManager.sh -username $USERNAME -password $PASSWORD
       echo "OK"
    else
       DebugText "ST Media Server Deploy Mgmr home not available:" [$SAMETIME_HOME_MEDIA/$MEDIA_DM_PROFILE]
    fi
 return 0
}

stop_media_server ()
{
 # Sametime MEDIA Server 
 if [ -d "$SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE" ] ; then
    echo -n "Stopping MEDIA Server: "
    $SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE/bin/stopServer.sh STMediaServer -username $USERNAME -password $PASSWORD
    echo "OK"
    
    echo -n "Stopping MEDIA Server NodeAgent: "
    $SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE/bin/stopNode.sh -username $USERNAME -password $PASSWORD
    echo "OK"
 else
   DebugText "ST Media Server home not available:" [$SAMETIME_HOME_MEDIA/$MEDIA_PN_PROFILE]
 fi  

 return 0
}

###########################################################   Main Script ##############################################################3

# Determine architecture and platform
#GetSystemArchitecture
#echo $PLATFORM_NAME

# --- Sanity check for server environment ---


case "$1" in
  start)
     # Sametime Deployment manager
     start_ssc_deploy_manager
     
     # Sametime System Console Server
     start_ssc_server

     # Sametime PROXY Server Deploy Manager
     start_proxy_deploy_manager

     # Sametime PROXY Server
     start_proxy_server

     # Sametime MEETING Server Deploy Manager
     start_meeting_deploy_manager

     # Sametime MEETING Server
     start_meeting_server

     # Sametime MEDIA Deploy Manager
     start_media_deploy_manager

     # Sametime MEDIA Server
     start_media_server                

  ;;
  stop)

     # Sametime MEDIA Server
     stop_media_server 

     # Sametime MEDIA Deploy Manager
     stop_media_deploy_manager

     # Sametime MEETING Server
     stop_meeting_server

     # Sametime MEETING Server Deploy Manager
     stop_meeting_deploy_manager 

     # Sametime PROXY Server
     stop_proxy_server

     # Sametime PROXY Server Deploy Manager
     stop_proxy_deploy_manager

     # Sametime System Console Server
     stop_ssc_server

     # Sametime Deployment manager
     stop_ssc_deploy_manager
     
 ;;
 reload|restart)
    $0 stop
    $0 start
 ;;
 *)
    DebugText "Invalid PARAM:" [$PARAM]
    usage 
    exit 1
 ;;
esac
exit 0