#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
##
##  rc.tomcat -- Run-Commands for Tomcat
##

%config
    tomcat_enable="yes"
    tomcat_home="@l_prefix@/libexec/tomcat"

%start -p 100 -u root
    if opServiceEnabled tomcat; then
        JAVA_HOME="$jdk_home"; export JAVA_HOME
        TOMCAT_HOME="$tomcat_home"; export TOMCAT_HOME
        @l_prefix@/libexec/tomcat/bin/tomcat.sh start
    fi

%stop -p 100 -u root
    if opServiceEnabled tomcat; then
        JAVA_HOME="$jdk_home"; export JAVA_HOME
        TOMCAT_HOME="$tomcat_home"; export TOMCAT_HOME
        @l_prefix@/libexec/tomcat/bin/tomcat.sh stop
    fi

%env
    if opServiceEnabled tomcat; then
        TOMCAT_HOME="$tomcat_home"
        export TOMCAT_HOME
    fi

