misc/docker-entrypoint.sh

Fri, 28 Dec 2018 04:41:09 -0500

author
Waqas Hussain <waqas20@gmail.com>
date
Fri, 28 Dec 2018 04:41:09 -0500
changeset 160
28aa762f11c7
parent 94
1b3e848b4394
permissions
-rw-r--r--

Include line_start and line_end in action objects and action log events for /run end-point

#!/bin/bash

ARGS=""

if [[ "$SERVER_HOST" ]]; then
	ARGS="$ARGS -h $SERVER_HOST";
else
	# In the interests of sane convenient defaults, discover the host
	# IP address (only possible in bridged networks), and default to that
	GATEWAY_IP=$(printf "%d.%d.%d.%d" $(awk '$2 == 00000000 { for (i = 8; i >= 2; i=i-2) { print "0x" substr($3, i-1, 2) } }' /proc/net/route))

	if [[ "$GATEWAY_IP" != "0.0.0.0" ]]; then
		ARGS="$ARGS -h $GATEWAY_IP"
	fi
fi
if [[ "$SERVER_PORT" ]]; then
	ARGS="$ARGS -p $SERVER_PORT";
fi

exec /usr/local/bin/scansion $ARGS "$@"

mercurial