090328133055_fedora 1.18 KB
Newer Older
ole's avatar
ole committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#!/bin/bash
. /etc/bash.bashrc
. /etc/rc.d/init.d/functions

case $1 in
        start)
                echo -n "Starting Fedora-Server"
                /var/opt/fedora/tomcat/bin/startup.sh
        ;;
        stop)
                #Check java
                pidof_fedora=`pidof java`
                if [ -z "$pidof_fedora" ] ; then
                        echo -n "Fedora is not running"
                else
                        echo -n "Shutting down Fedora"
                        /var/opt/fedora/tomcat/bin/shutdown.sh
                fi
        ;;
        restart)
                pidof_fedora=`pidof java`
                if [ -z "$pidof_fedora" ] ; then
                        echo -n "Fedora is not running"
                        echo -n "Starting Fedora-Server"
                        /var/opt/fedora/tomcat/bin/startup.sh

                else
                        echo -n "Restarting Fedora-Server"
                        echo -n "Shutting down Fedora-Server"
                        /var/opt/fedora/tomcat/bin/shutdown.sh
                        echo -n "Starting up Fedora-Server"
                        /var/opt/fedora/tomcat/bin/startup.sh
                fi
        ;;
esac