diff options
Diffstat (limited to 'dht/vnet/core-gettcp.sh')
-rwxr-xr-x | dht/vnet/core-gettcp.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/dht/vnet/core-gettcp.sh b/dht/vnet/core-gettcp.sh new file mode 100755 index 00000000..12204b84 --- /dev/null +++ b/dht/vnet/core-gettcp.sh | |||
@@ -0,0 +1,22 @@ | |||
1 | #!/usr/bin/awk --exec | ||
2 | BEGIN { | ||
3 | for( ARGC=1; ARGC<17; ARGC++ ) { | ||
4 | ARGV[ARGC] = "ve" sprintf("%X",ARGC - 1) "/PUBLIC_ID.txt"; | ||
5 | } | ||
6 | } | ||
7 | |||
8 | BEGINFILE { | ||
9 | boot_key = ""; | ||
10 | boot_port = ""; | ||
11 | boot_ip = ""; | ||
12 | boot_tcp = ""; | ||
13 | } | ||
14 | |||
15 | { | ||
16 | if ( boot_key == "" ) boot_key=$0; | ||
17 | else if( boot_port == "" && $1 == "Port:" ) boot_port=$2; | ||
18 | else if( boot_ip == "" && $1 == "IP:" ) boot_ip=$2; | ||
19 | else if( boot_tcp == "" && $1 == "TCP:" ) boot_tcp=$2; | ||
20 | } | ||
21 | |||
22 | ENDFILE { print( boot_key "@" boot_ip ":" boot_port "{tcp:" boot_tcp "}" ); } | ||