File benno-license-info of Package benno-rest

#! /bin/bash
# Script to get benno-rest host informations for licensing
# Copyright (c) 2012,2017,2018 Stefan Schaefer - FSP Computer & Netzwerke
# LICENSE GPLv3
#
# Author: Stefan Schaefer - stefan.schaefer@fsproductions.de

# Read configuration
SERVICE="benno-rest"
[ -r /etc/default/$SERVICE ] && . /etc/default/$SERVICE
[ -r /etc/benno/benno-global-service.conf ] && . /etc/benno/benno-global-service.conf

if [[ $SERVICE != "benno-smtp" ]]; then
    [ -r /etc/benno/$SERVICE-service.conf ] && . /etc/benno/$SERVICE-service.conf
else
    [ -r /etc/$SERVICE/$SERVICE-service.conf ] && . /etc/$SERVICE/$SERVICE-service.conf
fi

# Exit if components are not installed
test -x $SERVICE_BIN || { echo "$SERVICE_BIN not installed";
    if [ "$2" = "stop" ]; then exit 0; else exit 5; fi; }

test -r $SERVICE_JAR || { echo "$SERVICE_JAR not existing";
    if [ "$2" = "stop" ]; then exit 0; else exit 6; fi; }

# Set environment variables
export LANG=C

# Should the benno service be started?
if [ "$START_DAEMON"x != "yes"x ]; then
                echo "$SERVICE disabled: not starting. To enable it edit /etc/default/$SERVICE"
                exit 0
fi

# Get benno-rest host information
$SERVICE_BIN $SERVICE_INFO_OPTS --host-info 2>/dev/null

benno-client --instance-id
openSUSE Build Service is sponsored by