|
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 User : jackjohn ( 502) PHP Version : 5.3.17 Disable Function : NONE Directory : /sbin/ |
Upload File : |
#!/bin/sh
#
# Copyright 2009-2010 Red Hat, Inc. All rights reserved.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
REGDOMAIN=/etc/sysconfig/regdomain
CLOCK=/etc/sysconfig/clock
if [ -f $REGDOMAIN ]
then
# This should set COUNTRY
. $REGDOMAIN
if [ -n "$COUNTRY" ]
then
/sbin/iw reg set $COUNTRY
exit
fi
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
/sbin/iw reg set $COUNTRY