Sindbad~EG File Manager
| Current Path : /etc/rc3.d/ |
|
|
| Current File : //etc/rc3.d/S99vivaldiframeworkd |
#!/bin/bash
#description: Framework serice startup/shutdown script
# chkconfig: 2345 99 00
### BEGIN INIT INFO
# Provides: Framework
# Required-Start: $syslog
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 6
# Description: vivaldiframework service
### END INIT INFO
#Function to check status of Framework service
check_status() {
x=`ps -ef|grep java|grep Framework.jar`
if [ "$x" = "" ] ; then
return 3;
fi
return 0
}
#Function to start Framework service
start() {
\rm -f /tmp/network_present
. /etc/init.d/msm_profile
network_flag=0
for (( i=0; i < 20; i++ ))
do
if [ -f "$MSM_HOME/Framework/TestNetworkCapability.class" ]
then
echo "$MSM_PRODUCT with Network Capability">>/dev/null
"$MSM_HOME/jre/bin/java" -classpath "$MSM_HOME/jre/lib/rt.jar:$MSM_HOME/Framework" TestNetworkCapability
if [ -f /tmp/network_present ]
then
network_flag=1
i=21
\rm -f /tmp/network_present
else
sleep 5
fi
else
echo "$MSM_PRODUCT without Network Capability">>/dev/null
network_flag=1
i=21
fi
done
if [ $network_flag -eq 1 ]
then
echo "Trying to start Framework.....">>/dev/null
else
echo "$MSM_PRODUCT failed to start Framework..... Check your Network">>/dev/null
echo "Trying to start Framework without Network Capability.....">>/dev/null
fi
sh "$MSM_HOME/Framework/startup.sh" >> /dev/null 2>>/dev/null &
}
#function to stop Framework Service
stop() {
. /etc/init.d/msm_profile
sh "$MSM_HOME/Framework/shutdown.sh" >> /dev/null &
}
case "$1" in
start)
check_status
status=$?
if [ $status = 0 ]; then
echo "Framework is already running....."
else
echo "Starting Framework: "
start
fi
;;
stop)
check_status
status=$?
if [ $status = 3 ]; then
echo "Framework is already stopped....."
else
echo "Shutting down Framework: "
stop
fi
;;
restart|reload)
$0 stop
sleep 20
$0 start
;;
status)
check_status
RETVAL=$?
if [ $RETVAL = 0 ]; then
echo "Framework is running..."
else
if [ $RETVAL = 3 ]; then
echo "Framework is stopped..."
else
echo "Framework status unknown..."
fi
fi
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit $RETVAL
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists