#!/bin/bash

trap "exit 1" ERR

if [[ -z "${MAIN_URL}" ]]; then
	echo "MAIN_URL cannot be empty" >&2
	exit 1
fi

if [[ -z "${JENKINS_SMTP_FROM}" ]]; then
	echo "JENKINS_SMTP_FROM cannot by empty" >&2
	exit 1
fi

sed -i -re "s,MAIN_URL,${MAIN_URL},;s,JENKINS_SMTP_FROM,${JENKINS_SMTP_FROM}," /usr/share/jenkins/ref/jenkins.model.JenkinsLocationConfiguration.xml.override

exec /usr/local/bin/jenkins.sh "$@"

#!/bin/bash

trap "exit 1" ERR

if [[ -z "${MAIN_URL}" ]]; then
	echo "MAIN_URL cannot be empty" >&2
	exit 1
fi

if [[ -z "${JENKINS_SMTP_FROM}" ]]; then
	echo "JENKINS_SMTP_FROM cannot by empty" >&2
	exit 1
fi

sed -i -re "s,MAIN_URL,${MAIN_URL},;s,JENKINS_SMTP_FROM,${JENKINS_SMTP_FROM}," /usr/share/jenkins/ref/jenkins.model.JenkinsLocationConfiguration.xml.override

exec /sbin/tini -- /usr/local/bin/jenkins.sh "$@"

Make sure Jenkins correctly handles zombie processes
Make sure Jenkins correctly handles zombie processes

See: https://github.com/jenkinsci/docker/pull/124/commits/d5aea67dcae9d62fe4ca6ad961ffe66f65d9a591
