#!/usr/bin/env bash LOCALIP=$(ipconfig getifaddr en0) while true do nc -lk ${LOCALIP} 1234 #this shoul be remote ip done