Startup script for the pmagent
     

    #!/bin/bash
    #
    # Startup script for the pmagent
    #
    
    # chkconfig: 345 99 02
    # description: Run the ServiceDesk-Plus program
    
    INITLOG_ARGS=""
    
    prog="servicedesk"
    progname="AdventNet ManageEngine ServiceDesk-Plus"
    RETVAL=0
    # Edit the following to indicate the 'bin' directory for your installation
    MDIR=/home/guest/servicedesk/AdventNet/ME/ServiceDesk/bin
    
    if [ ! -d "$MDIR" ]
    then
     echo "Invalid directory $MDIR"
        exit 1
    fi
    
    start()
    {
            mv -f /var/log/servicedesk-plus.log /var/log/servicedesk-plus1.log
    	echo "Starting $progname"
            cd $MDIR
    	nohup sh run.sh >/var/log/servicedesk-plus.log 2>&1 &
    	RETVAL=$?
    	echo
    	[ $RETVAL = 0 ] && touch /var/lock/subsys/servicedesk
    }
    
    stop()
    {
    	echo "Stopping $progname"
            cd $MDIR
    	sh shutdown.sh -S >>/var/log/servicedesk-plus.log 2>&1  
    }
    
    case "$1" in
     start)
           start
             ;;
     stop)
          stop
            ;;
        *)
         echo "Usage: $prog {start|stop}"
         exit 1
         ;;
    esac
    
    exit $RETVAL 

    Copyright © 2017, ZOHO Corp. All Rights Reserved.