summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2011-07-01 14:51:20 +0200
committerLinus Nordberg <linus@nordu.net>2011-07-01 14:51:20 +0200
commit05fe8725e304ebedff7a86dcfe982222475bfadd (patch)
tree4ca8a6eb6915230a3c8e47672a6e3cec25bc3d8e
parent226f6c31d23e4c335ed64279a7e09274173355fb (diff)
Fix typos, spelling and whitespace in tools/naptr-eduroam.sh.
Also, change `test' to '['.
-rwxr-xr-xtools/naptr-eduroam.sh30
1 files changed, 15 insertions, 15 deletions
diff --git a/tools/naptr-eduroam.sh b/tools/naptr-eduroam.sh
index 99be5e1..be722c9 100755
--- a/tools/naptr-eduroam.sh
+++ b/tools/naptr-eduroam.sh
@@ -5,7 +5,7 @@
# realm given as argument, and creates a server template based
# on that. It currently ignores weight markers, but does sort
# servers on priority marker, lowest number first.
-# For host command this is coloumn 5, for dig it is coloumn 1.
+# For host command this is column 5, for dig it is column 1.
usage() {
/bin/echo "Usage: ${0} <realm>"
@@ -20,7 +20,7 @@ HOSTCMD=$(command -v host)
dig_it_srv() {
${DIGCMD} +short srv $SRV_HOST | sort -k1 |
- while read line ; do
+ while read line; do
set $line ; PORT=$3 ; HOST=$4
/bin/echo -e "\thost ${HOST%.}:${PORT}"
done
@@ -28,18 +28,18 @@ dig_it_srv() {
dig_it_naptr() {
${DIGCMD} +short naptr ${REALM} | grep x-eduroam:radius.tls | sort -k1 |
- while read line ; do
+ while read line; do
set $line ; TYPE=$3 ; HOST=$6
- if [ "$TYPE" = "\"s\"" ]; then {
- SRV_HOST=${HOST%.}
- dig_it_srv; };
+ if [ "$TYPE" = "\"s\"" ]; then
+ SRV_HOST=${HOST%.}
+ dig_it_srv
fi
done
}
host_it_srv() {
${HOSTCMD} -t srv $SRV_HOST | sort -k5 |
- while read line ; do
+ while read line; do
set $line ; PORT=$7 ; HOST=$8
/bin/echo -e "\thost ${HOST%.}:${PORT}"
done
@@ -47,25 +47,25 @@ host_it_srv() {
host_it_naptr() {
${HOSTCMD} -t naptr ${REALM} | grep x-eduroam:radius.tls | sort -k5 |
- while read line ; do
+ while read line; do
set $line ; TYPE=$7 ; HOST=${10}
- if [ "$TYPE" = "\"s\"" ]; then {
- SRV_HOST=${HOST%.}
- host_it_srv; }; fi
-
+ if [ "$TYPE" = "\"s\"" ]; then
+ SRV_HOST=${HOST%.}
+ host_it_srv
+ fi
done
}
-if test -x "${DIGCMD}" ; then
+if [ -x "${DIGCMD}" ]; then
SERVERS=$(dig_it_naptr)
-elif test -x "${HOSTCMD}" ; then
+elif [ -x "${HOSTCMD}" ]; then
SERVERS=$(host_it_naptr)
else
/bin/echo "${0} requires either \"dig\" or \"host\" command."
exit 1
fi
-if test -n "${SERVERS}" ; then
+if [ -n "${SERVERS}" ]; then
/bin/echo -e "server dynamic_radsec.${REALM} {\n${SERVERS}\n\ttype TLS\n}"
exit 0
fi