fixed port listing to sort numerically
[feisty_meow.git] / scripts / opensim / find_opensim_ports.sh
1 #!/bin/bash
2
3 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
4
5 outfile="$(mktemp "$TMP/region_ports.XXXXXX")"
6 grep "InternalPort *= *[0-9][0-9]*" "$HOME/opensim/bin/Regions"/* | sed -e "s/.*= *\([0-9]*\).*/\1/" | sort -g &>$outfile
7
8 if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then
9   sep
10   echo all ports are:
11   cat $outfile
12   sep
13   echo head
14   head -1 $outfile
15   sep
16   echo tail
17   tail -1 $outfile
18   sep
19 fi
20
21 echo "opensim ports range from $(head -1 $outfile) to $(tail -1 $outfile)"
22 rm $outfile
23
24