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