summaryrefslogtreecommitdiff
path: root/filesystem/etc/proxy_setting.sh
blob: d4f84dca7dac3157987c761961d7066171019f48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
__cmdline=`cat /proc/cmdline`

for arg in ${__cmdline} ; do
	if [[ ${arg} == proxy=* ]]; then
		__proxy=${arg##*=}
	fi
	if [[ ${arg} == dns1=* ]]; then
		__dns1=${arg##*=}
	fi
	if [[ ${arg} == dns2=* ]]; then
		__dns2=${arg##*=}
	fi
	if [[ ${arg} == openglip=* ]]; then
		__openglip=${arg##*=}
	fi
	if [[ ${arg} == sdb_port=* ]]; then
		__sdb_port=${arg##*=}
	fi
done

if cat /proc/cmdline | grep -q proxy ; then
	if [ "x${__proxy}" != "x" ] ; then
		kdb set user/dnet/profile_00/pdp/ProxyAddr "${__proxy}"
	fi
fi

if cat /proc/cmdline | grep -q dns ; then
	rm -rf /etc/resolv.conf
	if [ "x${__dns1}" != "x" ] ; then
		echo "nameserver ${__dns1}" >> /etc/resolv.conf
	fi
	if [ "x${__dns2}" != "x" ] ; then
		echo "nameserver ${__dns2}" >> /etc/resolv.conf
	fi
fi

if cat /proc/cmdline | grep -q openglip ; then
	rm -rf /opt/home/opengl_ip.txt
	if [ "x${__openglip}" != "x" ] ; then
		echo "${__openglip}" >> /opt/home/opengl_ip.txt
	fi
fi

if cat /proc/cmdline | grep -q sdb_port ; then
	rm -rf /opt/home/sdb_port.txt
	if [ "x${__sdb_port}" != "x" ] ; then
		echo "${__sdb_port}" >> /opt/home/sdb_port.txt
	fi
fi