You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcpcfg/helper/tt2-wrapper

20 lines
363 B

#!/bin/bash
NGCP_PORTFILE="${NGCP_PORTFILE:-/var/run/ngcpcfg.port}"
if [ -r "${NGCP_PORTFILE}" ] ; then
port=$(cat "${NGCP_PORTFILE}")
else
echo "ERROR: Couldn't read file ${NGCP_PORTFILE}" >&2
exit 1
fi
if ! [[ $port =~ [0-9]+ ]] ; then
echo "ERROR: Wrong ngcpcfg tt2-daemon port: $port" >&2
exit 1
fi
echo "$@" | netcat localhost "$port"
exit $?