blob: f39ba94c85121f609d267b4fedc55baed60810e7 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#!/bin/sh
2
3#
4#¸Ã½Å±¾ÓÃÓÚ»ñȡһЩͨÓõÄnv±äÁ¿¼°¶¨Ò幫¹²º¯ÊýʹÓÃ
5#
6
7####»ñȡͨÓÃnv±äÁ¿####
8path_conf=`nv get path_conf`
9test_log=`nv get telog_path`
10if [ "$test_log" == "" ]; then
11 test_log=`nv get path_log`"te.log"
12fi
13path_tmp=`nv get path_tmp`
14path_ro=`nv get path_ro`
15
16##getLanIfName
17lan_if=`nv get lan_name`
18#echo "LanIfName=$lan_if"
19
20##getWanIfName
21pswan_name=`nv get pswan`
22def_cid_tmp=`nv get default_cid`
23pswan_if=$pswan_name$def_cid_tmp
24ethwan_if=`nv get ethwan`
25wifiwan_if=`nv get wifiwan`
26
27#ipv4
28defwan_if=`nv get default_wan_name`
29defwan_rel=`nv get default_wan_rel`
30
31#ipv6
32defwan6_if=`nv get default_wan6_name`
33defwan6_rel=`nv get default_wan6_rel`
34
35####¹«¹²º¯Êý####
36#²éÕÒ¶ÔÓ¦dhcpc½ø³ÌºÅ²¢É±ËÀ
37udhcpc_kill()
38{
39 ps > ${path_tmp}/udhcpc.sh.$$
40 udhcpc_pid=`awk 'BEGIN{temp1="'"${wan_if}"'";temp2="'$path_sh/udhcpc.sh'"}{if(index($0,temp1)>0 && index($0,temp2)>0){print $1}}' ${path_tmp}/udhcpc.sh.$$`
41 rm -f ${path_tmp}/udhcpc.sh.$$
42 [ -n "$udhcpc_pid" ] && { kill -9 $udhcpc_pid; echo "Info: kill udhcpc $udhcpc_pid " >> $test_log ; }
43}
44#²éÕÒ¶ÔÓ¦pppoe½ø³ÌºÅ²¢É±ËÀ
45pppoe_kill()
46{
47 ps > ${path_tmp}/pppoecd.${wan_if}.$$
48 pppoe_pid=`awk 'BEGIN{temp1="'"${wan_if}"'";temp2="pppoecd"}{if(index($0,temp1)>0 && index($0,temp2)>0){print $1}}' ${path_tmp}/pppoecd.${wan_if}.$$`
49 rm -f ${path_tmp}/pppoecd.${wan_if}.$$
50 [ -n "$pppoe_pid" ] && { kill -9 $pppoe_pid; echo "Info: kill pppoecd $pppoe_pid " >> $test_log ; }
51}
52#²éÕÒ¶ÔÓ¦dhcp6s½ø³ÌºÅ²¢É±ËÀ
53dhcp6s_kill()
54{
55 ps > ${path_tmp}/${dhcp6s_conf##*/}.$$
56 dhcp6s_pid=`awk 'BEGIN{temp1="'"${dhcp6s_conf}"'";temp2="dhcp6s"}{if(index($0,temp1)>0 && index($0,temp2)>0){print $1}}' ${path_tmp}/${dhcp6s_conf##*/}.$$`
57 rm -f ${path_tmp}/${dhcp6s_conf##*/}.$$
58 [ -n "$dhcp6s_pid" ] && { kill -9 $dhcp6s_pid; echo "Info: kill dhcp6s $dhcp6s_pid " >> $test_log ; }
59}
60
61#²éÕÒ¶ÔÓ¦radvd½ø³ÌºÅ²¢É±ËÀ
62radvd_kill()
63{
64 ps > ${path_tmp}/${radvd_conf##*/}.$$
65 radvd_pid=`awk 'BEGIN{temp1="'"${radvd_conf}"'";temp2="radvd"}{if(index($0,temp1)>0 && index($0,temp2)>0){print $1}}' ${path_tmp}/${radvd_conf##*/}.$$`
66 rm -f ${path_tmp}/${radvd_conf##*/}.$$
67 [ -n "$radvd_pid" ] && { kill -9 $radvd_pid; echo "Info: kill radvd $radvd_pid " >> $test_log ; }
68}
69
70#²éÕÒ¶ÔÓ¦dhcp6c½ø³ÌºÅ²¢É±ËÀ
71dhcp6c_kill()
72{
73 ps > ${path_tmp}/dhcp6c.${wan_if}.$$
74 dhcp6c_pid=`awk 'BEGIN{temp1="'"${wan_if}"'";temp2="dhcp6c"}{if(index($0,temp1)>0 && index($0,temp2)>0){print $1}}' ${path_tmp}/dhcp6c.${wan_if}.$$`
75 rm -f ${path_tmp}/dhcp6c.${wan_if}.$$
76 [ -n "$dhcp6c_pid" ] && { kill -9 $dhcp6c_pid; echo "Info: kill dhcp6c $dhcp6c_pid " >> $test_log ; }
77}
78
79#²éÕÒ¶ÔÓ¦ndp½ø³ÌºÅ²¢É±ËÀ
80ndp_kill()
81{
82 ps > ${path_tmp}/${ndp_log##*/}.$$
83 ndp_pid=`awk 'BEGIN{temp1="'"${ndp_log}"'";temp2="zte_ndp"}{if(index($0,temp1)>0 && index($0,temp2)>0){print $1}}' ${path_tmp}/${ndp_log##*/}.$$`
84 rm -f ${path_tmp}/${ndp_log##*/}.$$
85 [ -n "$ndp_pid" ] && { kill -9 $ndp_pid; echo "Info: kill ndp $ndp_pid " >> $test_log ; }
86}
87