#!/bin/bash
#
# chkconfig: 35 98 5
# description: start and stop the DynamicOps VRM
#	       agent service	

InstallPath="/usr/share/gugent/vrm.pid"
# VRM Agent startup script
case "$1" in
        'start')
                if [ -x /usr/share/gugent/vrm-agentd ]; then
                        echo "Starting VRM Agent"
                        /usr/share/gugent/vrm-agentd /usr/share/gugent
                fi
                ;;
       	'stop')
                if [ -f $InstallPath ]; then
                        echo "Stopping VRM Agent"
                        kill -TERM `cat $InstallPath`
                else
                        echo "VRM Agent is not running"
                fi
                ;;
        *)
                echo "usage: $0 {start|stop}"
                ;;
esac
