Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions files/glbd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,15 @@ else
fi

wait_for_connections_to_drop() {
while (netstat -na | grep -m 1 ":$LISTEN_PORT " > /dev/null); do
echo "[`date`] $prog: waiting for lingering sockets to clear up..."
sleep 1s
done;
return 0
_LISTEN_ADDR=$LISTEN_ADDR
if [ "$_LISTEN_ADDR" = "$LISTEN_PORT" ]; then
_LISTEN_ADDR=":"$LISTEN_PORT
fi
while (netstat -na | awk '{ print $4 }' | grep "$_LISTEN_ADDR" > /dev/null); do
echo "[`date`] $prog: waiting for lingering sockets to clear up..."
sleep 1s
done;
return 0
}

stop() {
Expand Down