Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


3. Edit the various variables at the top of the script to reflect your environment, for instance where OFBiz is installed, where your JVM is installed, etc. 
For Debian based distrib use . /lib/lsb/init-functions as "Source function library" and replace "echo_" by "echo "
We may rather use the following snippet. But, as I'm not a Linux specialist, I let it here as an example for now...

Code Block
# detect the distribution:
if [ -f /etc/redhat-release -o -f /etc/fedora-release ] ; then
    DISTRIBUTION="redhat"
elif [ -f /etc/SuSE-release ] ; then
    DISTRIBUTION="suse"
elif [ -f /etc/debian_version ] ; then
    DISTRIBUTION="debian"
else
    echo "Error: unsupported distribution" >&2
    exit 1
fi 

# Source function library.
[ "$DISTRIBUTION" = "redhat" ] && . /etc/init.d/functions
[ "$DISTRIBUTION" = "suse" ] && . /etc/rc.status

if [ "$DISTRIBUTION" = "suse" ] ; then
    echo_success() {
        rc_status -v
    }
    echo_failure() {
        rc_status -v
    }
    success() {
        echo_success
    }
    failure() {
        echo_success
    }
elif [ "$DISTRIBUTION" = "debian" ] ; then
    echo_success() {
        echo ok
    }
    echo_failure() {
        echo failed
    }
    success() {
        echo_success
    }
    failure() {
        echo_success
    }
fi

...