xf.li | 8611891 | 2025-03-19 20:07:27 -0700 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | |
| 3 | # |
| 4 | #¸Ã½Å±¾ÓÃÓÚ»ñȡһЩͨÓõÄnv±äÁ¿¼°¶¨Ò幫¹²º¯ÊýʹÓà |
| 5 | # |
| 6 | |
| 7 | ####»ñȡͨÓÃnv±äÁ¿#### |
| 8 | path_conf=`nv get path_conf` |
| 9 | test_log=`nv get telog_path_cap` |
| 10 | if [ "$test_log" == "" ]; then |
| 11 | test_log=`nv get path_log`"te.log" |
| 12 | fi |
| 13 | path_tmp=`nv get path_tmp` |
| 14 | path_ro=`nv get path_ro` |
| 15 | |
| 16 | ##getLanIfName |
| 17 | lan_if=`nv get lan_name` |
| 18 | #echo "LanIfName=$lan_if" |
| 19 | ##getLanIfName |
| 20 | lan_if_cap=`nv get lan_name_cap` |
| 21 | |
| 22 | ##getWanIfName |
| 23 | pswan_name=`nv get pswan` |
| 24 | def_cid_tmp=`nv get default_cid` |
| 25 | pswan_if=$pswan_name$def_cid_tmp |
| 26 | ethwan_if=`nv get ethwan` |
| 27 | wifiwan_if=`nv get wifiwan` |
| 28 | pswan_cap_name=`nv get pswan_cap` |
| 29 | pswan_cap_if=$pswan_cap_name$def_cid_tmp |
| 30 | #ipv4 |
| 31 | defwan_if=`nv get default_wan_name` |
| 32 | defwan_rel=`nv get default_wan_rel` |
| 33 | |
| 34 | #ipv6 |
| 35 | defwan6_if=`nv get default_wan6_name` |
| 36 | defwan6_rel=`nv get default_wan6_rel` |
| 37 | |
| 38 | ####¹«¹²º¯Êý#### |
| 39 | #²éÕÒ¶ÔÓ¦dhcpc½ø³ÌºÅ²¢É±ËÀ |
| 40 | udhcpc_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½ø³ÌºÅ²¢É±ËÀ |
| 48 | pppoe_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½ø³ÌºÅ²¢É±ËÀ |
| 56 | dhcp6s_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½ø³ÌºÅ²¢É±ËÀ |
| 65 | radvd_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½ø³ÌºÅ²¢É±ËÀ |
| 74 | dhcp6c_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½ø³ÌºÅ²¢É±ËÀ |
| 83 | ndp_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 | |