Fix ephemeral_port to prevent messing logpipe

This commit is contained in:
Martchus 2018-03-19 20:08:17 +01:00
parent f4071f40ab
commit 23f9b27e65
2 changed files with 2 additions and 20 deletions

View File

@ -38,16 +38,7 @@ source=("${pkgname}-${pkgver}.tar.gz::https://github.com/Martchus/${_reponame}/a
sha256sums=('bb68130de4bb47fb7da4d4cefecbec6ec5fca3408790c172dfd9779b7e3b14d7')
ephemeral_port() {
local lport=32768;
local uport=60999;
while true; do
local mport=$[$lport + ($RANDOM % $uport)];
(echo '' >/dev/tcp/127.0.0.1/${mport}) >/dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo $mport;
return 0;
fi
done
comm -23 <(seq 49152 65535) <(ss -tan | awk '{print $4}' | cut -d':' -f2 | grep "[0-9]\{1,5\}" | sort | uniq) | shuf | head -n 1
}
build() {

View File

@ -41,16 +41,7 @@ source=("${_reponame}::${MARTCHUS_GIT_URL_PREFIX:-git://github.com/Martchus}/${_
sha256sums=('SKIP')
ephemeral_port() {
local lport=32768;
local uport=60999;
while true; do
local mport=$[$lport + ($RANDOM % $uport)];
(echo '' >/dev/tcp/127.0.0.1/${mport}) >/dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo $mport;
return 0;
fi
done
comm -23 <(seq 49152 65535) <(ss -tan | awk '{print $4}' | cut -d':' -f2 | grep "[0-9]\{1,5\}" | sort | uniq) | shuf | head -n 1
}
pkgver() {