[crda] setregdomain: remove sed and awk calls
John W. Linville
linville at fedoraproject.org
Wed Apr 3 20:11:00 UTC 2013
commit b46ae0aa324a8374459ab4f9cf53ea5d11481739
Author: Harald Hoyer <harald at redhat.com>
Date: Wed Apr 3 16:02:17 2013 -0400
setregdomain: remove sed and awk calls
setregdomain | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/setregdomain b/setregdomain
index 7664c59..2a0cee0 100755
--- a/setregdomain
+++ b/setregdomain
@@ -31,7 +31,8 @@ fi
if [ -f $TZ ]
then
- ZONE=$(readlink $LOCALTIME | sed -e 's/\/usr\/share\/zoneinfo\///')
+ ZONE=$(readlink $LOCALTIME)
+ ZONE=${ZONE#/usr/share/zoneinfo/}
else
echo "Timezone information not found! Unable to set regulatory domain."
exit
@@ -43,7 +44,7 @@ then
exit
fi
-COUNTRY=$(grep $ZONE /usr/share/zoneinfo/zone.tab | awk '{ print $1 }')
+COUNTRY=$(while read c a z r; do if [ "$z" = "$ZONE" ]; then echo $c; break; fi ;done < /usr/share/zoneinfo/zone.tab)
if [ -z "$COUNTRY" ]
then
More information about the scm-commits
mailing list