summaryrefslogtreecommitdiff
path: root/dht/vnet/core-gettcp.sh
blob: 12204b84cdd6a678e80d3a3db50a9cf344c964c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/awk --exec
BEGIN {
	for( ARGC=1; ARGC<17; ARGC++ ) {
		ARGV[ARGC] = "ve" sprintf("%X",ARGC - 1) "/PUBLIC_ID.txt";
	}
}

BEGINFILE {
	boot_key  = "";
	boot_port = "";
	boot_ip   = "";
	boot_tcp  = "";
}

{
	if     ( boot_key  == ""                   ) boot_key=$0;
	else if( boot_port == "" && $1  == "Port:" ) boot_port=$2;
	else if( boot_ip   == "" && $1  == "IP:"   ) boot_ip=$2;
	else if( boot_tcp  == "" && $1  == "TCP:"  ) boot_tcp=$2;
}

ENDFILE { print( boot_key "@" boot_ip ":" boot_port "{tcp:" boot_tcp "}" ); }