[crda] setregdomain: reimplement COUNTRY assignment with shell function

John W. Linville linville at fedoraproject.org
Wed Apr 3 20:11:05 UTC 2013


commit 2c17588d863a616d22a0f5fe27f54b47605523c2
Author: John W. Linville <linville at tuxdriver.com>
Date:   Wed Apr 3 16:08:50 2013 -0400

    setregdomain: reimplement COUNTRY assignment with shell function

 setregdomain |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/setregdomain b/setregdomain
index 2a0cee0..3289260 100755
--- a/setregdomain
+++ b/setregdomain
@@ -18,6 +18,17 @@
 REGDOMAIN=/etc/sysconfig/regdomain
 LOCALTIME=/etc/localtime
 
+getcountry() {
+	while read c a z r
+	do
+		if [ "$z" = "$ZONE" ]
+		then
+			echo $c
+			break
+		fi
+	done < /usr/share/zoneinfo/zone.tab
+}
+
 if [ -f $REGDOMAIN ]
 then
 	# This should set COUNTRY
@@ -44,7 +55,7 @@ then
 	exit
 fi
 
-COUNTRY=$(while read c a z r; do if [ "$z" = "$ZONE" ]; then echo $c; break; fi ;done < /usr/share/zoneinfo/zone.tab)
+COUNTRY=$(getcountry)
 
 if [ -z "$COUNTRY" ]
 then


More information about the scm-commits mailing list