Using GeoClue to send a Linux wireless regulatory hint
Luis R. Rodriguez
mcgrof at gmail.com
Fri Jul 17 09:54:53 PDT 2009
On Fri, Jul 17, 2009 at 9:52 AM, Luis R. Rodriguez<mcgrof at gmail.com> wrote:
> It just reads the country from timezone file, I've pasted the script
> below inline in case you are curious.
Oh and here is the script used by Fedora (thanks to John):
#!/bin/sh
REGDOMAIN=/etc/sysconfig/regdomain
CLOCK=/etc/sysconfig/clock
if [ -f $REGDOMAIN ]
then
# This should set COUNTRY
. $REGDOMAIN
iw reg set $COUNTRY
exit
fi
if [ -f $CLOCK ]
then
# This should set ZONE
. $CLOCK
else
echo "Timezone information not found! Unable to set regulatory domain."
exit
fi
if [ -z "$ZONE" ]
then
echo "Timezone information not set! Unable to set regulatory domain."
exit
fi
COOKED_ZONE=$(echo $ZONE | sed -e 's/ /_/')
COUNTRY=$(grep $COOKED_ZONE /usr/share/zoneinfo/zone.tab | awk '{ print $1 }')
if [ -z "$COUNTRY" ]
then
echo "Could not determine country! Unable to set regulatory domain."
exit
fi
iw reg set $COUNTRY
More information about the GeoClue
mailing list