HEX
Server: nginx/1.22.1
System: Linux VM-16-9-centos 3.10.0-1160.99.1.el7.x86_64 #1 SMP Wed Sep 13 14:19:20 UTC 2023 x86_64
User: www (1001)
PHP: 7.3.31
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: //proc/28282/root/sbin/setregdomain
#!/bin/sh
#
# Copyright 2009-2014 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
LOCALTIME=/etc/localtime

LOGGER="/usr/bin/logger -t crda"

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
	. $REGDOMAIN
	if [ -n "$COUNTRY" ]
	then
		/usr/sbin/iw reg set $COUNTRY
		exit
	fi
fi

if [ -f "$LOCALTIME" ]
then
	ZONE=$(readlink -f $LOCALTIME)
	ZONE=${ZONE#/usr/share/zoneinfo/}
else
	$LOGGER -s "Timezone information not found!  Unable to set regulatory domain."
	exit 1
fi

if [ -z "$ZONE" -o "$ZONE" = "$LOCALTIME" ]
then
	$LOGGER -s "Could not determine timezone!  Unable to set regulatory domain."
	exit 1
fi

COUNTRY=$(getcountry)

if [ -z "$COUNTRY" ]
then
	$LOGGER -s "Could not determine country!  Unable to set regulatory domain."
	exit 1
fi

$LOGGER "setting regulatory domain to $COUNTRY based on timezone ($ZONE)"
/usr/sbin/iw reg set $COUNTRY