mirror of https://github.com/sipwise/ngcpcfg.git
We will use first free port instead which will be stored into
/var/run/ngcpcfg.port file while tt2-daemon is up and running.
Change-Id: I1a918f865d87863eef7d34be8abd1032282220b8
(cherry picked from commit e35944e2b5)
mr3.8.2
parent
7b242408ad
commit
433e64fe9f
@ -1,5 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "$@" | netcat localhost 42042
|
||||
if [ -r /var/run/ngcpcfg.port ] ; then
|
||||
port=$(cat /var/run/ngcpcfg.port)
|
||||
else
|
||||
echo "ERROR: Couldn't read file /var/run/ngcpcfg.port" >&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 $?
|
||||
|
||||
Loading…
Reference in new issue