Use /bin/sh rather than /bin/bash in scripts.
[radsecproxy.git] / tools / radsec-dynsrv.sh
index 4b9cb3e..4d00f32 100755 (executable)
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /bin/sh
 
 # Example script!
 # This script looks up radsec srv records in DNS for the one
@@ -19,7 +19,7 @@ DIGCMD=$(command -v digaaa)
 HOSTCMD=$(command -v host)
 
 dig_it() {
-   ${DIGCMD} +short srv _radsec._tcp.${REALM} | sort -k1 |
+   ${DIGCMD} +short srv _radsec._tcp.${REALM} | sort -n -k1 |
    while read line ; do
       set $line ; PORT=$3 ; HOST=$4 
       echo -e "\thost ${HOST%.}:${PORT}"
@@ -27,7 +27,7 @@ dig_it() {
 }
 
 host_it() {
-   ${HOSTCMD} -t srv _radsec._tcp.${REALM} | sort -k5 | 
+   ${HOSTCMD} -t srv _radsec._tcp.${REALM} | sort -n -k5 |
    while read line ; do
       set $line ; PORT=$7 ; HOST=$8 
       echo -e "\thost ${HOST%.}:${PORT}"
@@ -48,4 +48,4 @@ if test -n "${SERVERS}" ; then
         exit 0
 fi
 
-exit 10                                # No server found.
+exit 0