Hi.
I have to write a script under bash shell.
This script use nc utility.
Everything is working on the virtual server of the hosting provider.
In my script, nc utility is listening port 27050 for UDP-packets and receiving them. But my script have to know the IP-address and the port of sender of the packet, to answer to it with an acknowledge or with a message.
I write in bash command line:
How else can I check the IP and the port of incoming packet?
I think, the hosting provider, shouldn't give me the right to install any daemons.
I have to write a script under bash shell.
This script use nc utility.
Everything is working on the virtual server of the hosting provider.
Code:
BASH_VERSION='4.2.50(1)-release'
uname -a
FreeBSD web1126.nic.ru 8.1-RELEASE FreeBSD 8.3-RELEASE-p4 #4: Thu Jan 30 00:00:49 MSK 2014
In my script, nc utility is listening port 27050 for UDP-packets and receiving them. But my script have to know the IP-address and the port of sender of the packet, to answer to it with an acknowledge or with a message.
I write in bash command line:
nc -ul 27050 -v 1>zxc.txt 2>err.txt. After this, incoming packets appearing in zxc.txt, but err.txt is clean. But in Linux the "-v" key makes nc to write something like this:
Code:
Received packet from 127.0.0.1:35373 -> 127.0.0.1:7878 (local).
I think, the hosting provider, shouldn't give me the right to install any daemons.