add dc1svr

This commit is contained in:
paldier 2019-02-12 18:52:22 +08:00
parent f2f731813e
commit 628a3434f0
37 changed files with 1376 additions and 11 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
softcenter/to_remove.txt
softcenter/.idea
~

25
dc1svr/backup.sh Executable file
View File

@ -0,0 +1,25 @@
#! /bin/sh
# you can do something here
# this shell scripts will run at the end of build.py scripts
mkdir -p history
if [ ! -f ./history/version ];then
touch ./history/version
fi
version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
md5_new=` md5sum dc1svr.tar.gz | awk '{print $1}'`
if [ -f ./dc1svr.tar.gz ];then
if [ "$version_old" != "$version_new" ];then
mkdir ./history/$version_new/
cp ./dc1svr.tar.gz ./history/$version_new/
echo $version_new $md5_new >> ./history/version
fi
fi

30
dc1svr/build.sh Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
MODULE=dc1svr
VERSION=1.0
TITLE=dc1服务器
DESCRIPTION=dc1服务器
HOME_URL=Module_dc1svr.asp
# Check and include base
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ "$MODULE" == "" ]; then
echo "module not found"
exit 1
fi
if [ -f "$DIR/$MODULE/$MODULE/install.sh" ]; then
echo "install script not found"
exit 2
fi
# now include build_base.sh
. $DIR/../softcenter/build_base.sh
# change to module directory
cd $DIR
# do something here
do_build_result

8
dc1svr/config.json.js Normal file
View File

@ -0,0 +1,8 @@
{
"version":"1.0",
"md5":"7bab90695d4d9b38a03bc15aa2b20637",
"home_url":"Module_dc1svr.asp",
"title":"dc1服务器",
"description":"dc1服务器",
"build_date":"2019-02-12_18:38:27"
}

BIN
dc1svr/dc1svr.tar.gz Normal file

Binary file not shown.

BIN
dc1svr/dc1svr/bin/dc1svr Executable file

Binary file not shown.

31
dc1svr/dc1svr/install.sh Normal file
View File

@ -0,0 +1,31 @@
#!/bin/sh
enable=`dbus get dc1svr_enable`
if [ "$enable" == "1" ];then
restart=1
dbus set dc1svr_enable=0
sh /jffs/softcenter/scripts/dc1.sh
fi
# cp files
cp -rf /tmp/dc1svr/scripts/* /jffs/softcenter/scripts/
cp -rf /tmp/dc1svr/bin/* /jffs/softcenter/bin/
cp -rf /tmp/dc1svr/webs/* /jffs/softcenter/webs/
cp -rf /tmp/dc1svr/res/* /jffs/softcenter/res/
# delete install tar
rm -rf /tmp/dc1svr* >/dev/null 2>&1
chmod a+x /jffs/softcenter/scripts/dc1.sh
chmod 0755 /jffs/softcenter/bin/dc1svr
dbus set dc1svr_version="1.0"
dbus set softcenter_module_dc1svr_version="1.0"
dbus set softcenter_module_dc1svr_description="dc1服务器"
dbus set softcenter_module_dc1svr_install=1
dbus set softcenter_module_dc1svr_name=dc1svr
dbus set softcenter_module_dc1svr_title="dc1服务器"
if [ "$restart" == "1" ];then
dbus set dc1svr_enable=1
sh /jffs/softcenter/scripts/dc1.sh
fi

BIN
dc1svr/dc1svr/res/icon-dc1svr.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -0,0 +1,32 @@
#!/bin/sh
# load path environment in dbus databse
eval `dbus export dc1svr`
source /jffs/softcenter/scripts/base.sh
CONFIG_FILE=/tmp/etc/dnsmasq.user/dc1.conf
start_dc1(){
/jffs/softcenter/bin/dc1svr
echo "address=/Smartplugconnect.phicomm.com/$(nvram get lan_ipaddr)" > $CONFIG_FILE
service restart_dnsmasq
if [ ! -e "/jffs/softcenter/init.d/S97dc1svr.sh" ]; then
cp -f /jffs/softcenter/scripts/dc1svr.sh /jffs/softcenter/init.d/S97dc1svr.sh
fi
}
stop_dc1(){
killall dc1svr
rm $CONFIG_FILE
rm /jffs/softcenter/init.d/S97dc1svr.sh
service restart_dnsmasq
}
startdc1(){
if [ "$dc1svr_enable" == "1" ]; then
logger "[软件中心]: 启动dc1服务器"
start_dc1
fi
}
case $ACTION in
*)
startdc1
;;
esac

View File

@ -0,0 +1,192 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache" />
<meta HTTP-EQUIV="Expires" CONTENT="-1" />
<link rel="shortcut icon" href="images/favicon.png" />
<link rel="icon" href="images/favicon.png" />
<title>软件中心 - DC1服务器</title>
<link rel="stylesheet" type="text/css" href="index_style.css" />
<link rel="stylesheet" type="text/css" href="form_style.css" />
<link rel="stylesheet" type="text/css" href="usp_style.css" />
<link rel="stylesheet" type="text/css" href="ParentalControl.css">
<link rel="stylesheet" type="text/css" href="css/icon.css">
<link rel="stylesheet" type="text/css" href="css/element.css">
<script type="text/javascript" src="/state.js"></script>
<script type="text/javascript" src="/popup.js"></script>
<script type="text/javascript" src="/help.js"></script>
<script type="text/javascript" src="/validator.js"></script>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/general.js"></script>
<script type="text/javascript" src="/switcherplugin/jquery.iphone-switch.js"></script>
<script language="JavaScript" type="text/javascript" src="/client_function.js"></script>
<script type="text/javascript" src="/dbconf?p=dc1svr_&v=<% uptime(); %>"></script>
<script>
var $j = jQuery.noConflict();
function init() {
show_menu(menu_hook);
buildswitch();
version_show();
var rrt = document.getElementById("switch");
if (document.form.dc1svr_enable.value != "1") {
rrt.checked = false;
} else {
rrt.checked = true;
}
}
function done_validating() {
return true;
}
function buildswitch(){
$j("#switch").click(
function(){
if(document.getElementById('switch').checked){
document.form.dc1svr_enable.value = 1;
}else{
document.form.dc1svr_enable.value = 0;
}
});
}
function onSubmitCtrl(o, s) {
document.form.action_mode.value = s;
showLoading(3);
document.form.submit();
}
function reload_Soft_Center(){
location.href = "/Main_Soft_center.asp";
}
function version_show(){
$j("#dc1svr_version_status").html("<i>当前版本:" + db_dc1svr_['dc1svr_version']);
$j.ajax({
url: 'https://raw.githubusercontent.com/paldier/softcenter/master/dc1svr/config.json.js',
type: 'GET',
success: function(res) {
var txt = $j(res.responseText).text();
if(typeof(txt) != "undefined" && txt.length > 0) {
//console.log(txt);
var obj = $j.parseJSON(txt.replace("'", "\""));
$j("#dc1svr_version_status").html("<i>当前版本:" + obj.version);
if(obj.version != db_dc1svr_["dc1svr_version"]) {
$j("#dc1svr_version_status").html("<i>有新版本:" + obj.version);
}
}
}
});
}
function menu_hook(title, tab) {
tabtitle[tabtitle.length -1] = new Array("", "软件中心", "离线安装", "DC1服务器");
tablink[tablink.length -1] = new Array("", "Main_Soft_center.asp", "Main_Soft_setting.asp", "Module_dc1svr.asp");
}
</script>
</head>
<body onload="init();">
<div id="TopBanner"></div>
<div id="Loading" class="popup_bg"></div>
<iframe name="hidden_frame" id="hidden_frame" src="" width="0" height="0" frameborder="0"></iframe>
<form method="POST" name="form" action="/applydb.cgi?p=dc1svr_" target="hidden_frame">
<input type="hidden" name="current_page" value="Module_dc1svr.asp" />
<input type="hidden" name="next_page" value="Module_dc1svr.asp" />
<input type="hidden" name="group_id" value="" />
<input type="hidden" name="modified" value="0" />
<input type="hidden" name="action_mode" value="" />
<input type="hidden" name="action_script" value="dc1.sh" />
<input type="hidden" name="action_wait" value="5" />
<input type="hidden" name="first_time" value="" />
<input type="hidden" name="preferred_lang" id="preferred_lang" value="<% nvram_get(" preferred_lang "); %>"/>
<input type="hidden" name="firmver" value="<% nvram_get(" firmver "); %>"/>
<input type="hidden" id="dc1svr_enable" name="dc1svr_enable" value='<% dbus_get_def("dc1svr_enable", "0"); %>' />
<table class="content" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="17">&nbsp;</td>
<td valign="top" width="202">
<div id="mainMenu"></div>
<div id="subMenu"></div>
</td>
<td valign="top">
<div id="tabMenu" class="submenuBlock"></div>
<table width="98%" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top">
<table width="760px" border="0" cellpadding="5" cellspacing="0" bordercolor="#6b8fa3" class="FormTitle" id="FormTitle">
<tr>
<td bgcolor="#4D595D" colspan="3" valign="top">
<div>&nbsp;</div>
<div style="float:left;" class="formfonttitle">DC1服务器 - 替换官方服务器</div>
<div style="float:right; width:15px; height:25px;margin-top:10px">
<img id="return_btn" onclick="reload_Soft_Center();" align="right" style="cursor:pointer;position:absolute;margin-left:-30px;margin-top:-25px;" title="返回软件中心" src="/images/backprev.png" onMouseOver="this.src='/images/backprevclick.png'" onMouseOut="this.src='/images/backprev.png'"></img>
</div>
<div style="margin-left:5px;margin-top:10px;margin-bottom:10px">
<img src="/images/New_ui/export/line_export.png">
</div>
<div class="formfontdesc" id="cmdDesc">该工具用于“DC1插排”。</div>
<div class="formfontdesc" id="cmdDesc"></div>
<table style="margin:10px 0px 0px 0px;" width="100%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#6b8fa3" class="FormTable" id="dc1_table">
<thead>
<tr>
<td colspan="2">工具选项</td>
</tr>
</thead>
<tr>
<th>开启DC1服务器</th>
<td colspan="2">
<div class="switch_field" style="display:table-cell;float: left;">
<label for="switch">
<input id="switch" class="switch" type="checkbox" style="display: none;">
<div class="switch_container">
<div class="switch_bar"></div>
<div class="switch_circle transition_style">
<div></div>
</div>
</div>
</label>
</div>
<div id="dc1svr_version_show" style="padding-top:5px;margin-left:230px;margin-top:0px;"><i>当前版本:<% dbus_get_def("dc1svr_version", "未知"); %></i>
</div>
<div id="dc1svr_install_show" style="padding-top:5px;margin-left:330px;margin-top:-25px;"></div>
<a style="margin-left: 318px;" href="https://raw.githubusercontent.com/paldier/softcenter/master/dc1svr/Changelog.txt" target="_blank"><em>[<u> 更新日志 </u>]</em></a>
</td>
</tr>
</table>
<div class="apply_gen">
<button id="cmdBtn" class="button_gen" onclick="onSubmitCtrl()">提交</button>
</div>
<div style="margin-left:5px;margin-top:10px;margin-bottom:10px">
<img src="/images/New_ui/export/line_export.png">
</div>
<div id="NoteBox">
<h2>使用说明:</h2>
<a style="margin-left: 318px;" href="https://www.right.com.cn/forum/thread-448025-1-1.html" target="_blank"><em>[<u> 点我跳转 </u>]</em></a>
<h2>申明:本工具来自恩山论坛 <a href="https://www.right.com.cn/forum/thread-448025-1-1.html" target="_blank">点我跳转</a></h2>
</div>
<div style="margin-left:5px;margin-top:10px;margin-bottom:10px">
<img src="/images/New_ui/export/line_export.png">
</div>
<div class="Bottom">
<br/>论坛技术支持:
<a href="http://www.koolshare.cn" target="_blank"> <i><u>www.koolshare.cn</u></i>
</a>
<br/>后台技术支持: <i>Xiaobao</i>
<br/>Shell, Web by <i>paldier</i>
<br/>
</div>
</td>
</tr>
</table>
</td>
<td width="10" align="center" valign="top"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</td>
<div id="footer"></div>
</body>
</html>

2
dc1svr/version Normal file
View File

@ -0,0 +1,2 @@
1.0
7bab90695d4d9b38a03bc15aa2b20637

View File

@ -84,8 +84,6 @@
var enable_ss = "<% nvram_get("enable_ss"); %>";
var enable_soft = "<% nvram_get("enable_soft"); %>";
function menu_hook(title, tab) {
tabtitle[tabtitle.length -1] = new Array("", "KMS");
tablink[tablink.length -1] = new Array("", "Module_kms.asp");
tabtitle[tabtitle.length -1] = new Array("", "软件中心", "离线安装", "KMS");
tablink[tablink.length -1] = new Array("", "Main_Soft_center.asp", "Main_Soft_setting.asp", "Module_kms.asp");
}

24
mdial/backup.sh Executable file
View File

@ -0,0 +1,24 @@
#! /bin/sh
# you can do something here
# this shell scripts will run at the end of build.py scripts
tar_name="$1.tar.gz"
mkdir -p history
if [ ! -f ./history/version ];then
touch ./history/version
fi
version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
md5_new=` md5sum $tar_name | awk '{print $1}'`
if [ -f ./$tar_name ];then
if [ "$version_old" != "$version_new" ];then
mkdir ./history/$version_new/
cp ./$tar_name ./history/$version_new/
echo $version_new $md5_new >> ./history/version
fi
fi

0
mdial/backup.sh~ Normal file
View File

22
mdial/build.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
MODULE="mdial"
VERSION="1.3"
TITLE="单线多拨"
DESCRIPTION="pppoe单线多拨带宽提升神器"
HOME_URL="Module_mdial.asp"
# Check and include base
DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )"
# now include build_base.sh
. $DIR/../softcenter/build_base.sh
# change to module directory
cd $DIR
# do something here
do_build_result
sh backup.sh $MODULE

0
mdial/build.sh~ Normal file
View File

8
mdial/config.json.js Normal file
View File

@ -0,0 +1,8 @@
{
"version":"1.3",
"md5":"becd45a122614c2c2290c66aa11332d1",
"home_url":"Module_mdial.asp",
"title":"单线多拨",
"description":"pppoe单线多拨带宽提升神器",
"build_date":"2019-01-23_18:38:39"
}

Binary file not shown.

1
mdial/history/version Normal file
View File

@ -0,0 +1 @@
1.3 dd4abcd5d03ad42d97fe46f1fa92f6fe

BIN
mdial/mdial.tar.gz Normal file

Binary file not shown.

35
mdial/mdial/install.sh Normal file
View File

@ -0,0 +1,35 @@
#!/bin/sh
export KSROOT=/jffs/softcenter
source $KSROOT/scripts/base.sh
mdial_enable=`dbus get mdial_enable`
find /jffs/softcenter/init.d/ -name "*mdial*" | xargs rm -rf
find /jffs/softcenter/init.d/ -name "*mdial*" | xargs rm -rf
if [ "$mdial_enable" == "1" ];then
[ -f "/jffs/softcenter/scripts/mdial_config.sh" ] && sh /jffs/softcenter/scripts/mdial_config.sh stop
fi
cp -rf /tmp/mdial/scripts/* /jffs/softcenter/scripts/
cp -rf /tmp/mdial/webs/* /jffs/softcenter/webs/
cp -rf /tmp/mdial/res/* /jffs/softcenter/res/
cp -rf /tmp/mdial/uninstall.sh /jffs/softcenter/scripts/uninstall_mdial.sh
rm -fr /tmp/mdial* >/dev/null 2>&1
chmod +x /jffs/softcenter/scripts/mdial*.sh
chmod +x /jffs/softcenter/scripts/uninstall_mdial.sh
[ ! -L "/jffs/softcenter/init.d/S10mdial.sh" ] && cp -rf /jffs/softcenter/scripts/mdial_config.sh /jffs/softcenter/init.d/S10mdial.sh
dbus set mdial_version="1.0"
dbus set softcenter_module_mdial_version="1.0"
dbus set softcenter_module_mdial_description="pppoe单线多拨带宽提升神器"
dbus set softcenter_module_mdial_install=1
dbus set softcenter_module_mdial_name=mdial
dbus set softcenter_module_mdial_title="单线多拨"
sleep 1
if [ "$mdial_enable" == "1" ];then
[ -f "/jffs/softcenter/scripts/mdial_config.sh" ] && sh /jffs/softcenter/scripts/mdial_config.sh start
fi

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -0,0 +1 @@
<% nvram_dump("mdial.log",""); %>

View File

@ -0,0 +1,2 @@
<% nvram_dump("mdial_log.log",""); %>

View File

@ -0,0 +1,178 @@
#!/bin/sh
eval `dbus export mdial_`
source /jffs/softcenter/scripts/base.sh
alias echo_date='echo 【$(TZ=UTC-8 date -R +%Y年%m月%d日\ %X)】:'
LOG_FILE=/tmp/mdial_log.log
echo " " > $LOG_FILE
start(){
echo_date "==========================================================="
if [ "$(nvram get wan_proto)" != "pppoe" ];then
echo_date "你的网络不是pppoe拨号方式不能使用本插件"
echo_date "退出!!"
echo_date "==========================================================="
dbus set mdial_enable=0
return 1
fi
num=$mdial_nu
dialed=`ifconfig | grep -c ppp[0-9]`
max_ppp=$(ifconfig | grep ppp[0-9]|awk '{print $1}'|sed 's/ppp//g'|sort -n|tail -n1)
if [ $dialed -lt $num ];then
dial_nu=$(($num - $dialed))
echo_date "已经拨号$dialed个,还需要拨号$dial_nu个"
start_dial $dialed $dial_nu $max_ppp
elif [ $dialed -eq $num ];then
echo_date "已经拨号$dialed个,不需要继续拨号"
elif [ $dialed -gt $num ];then
kill_nu=$(($dialed - $num))
echo_date "已经拨号$dialed个,需要关闭$kill_nu个"
fi
}
start_dial(){
local dialed_nu=$1
local dial_nu=$2
local ppp_nu=$(($3 + 1))
local count=0
#echo dialed_nu $dialed_nu
#echo dial_nu $dial_nu
#echo ppp_nu $ppp_nu
mkdir -p /jffs/softcenter/configs/mdial
rm -rf /jffs/softcenter/configs/mdial/*
# 生成已拨号的负载均衡命令
cmd="ip route add default"
local lb_count=1
while [ $lb_count -le $dialed_nu ]
do
local pppoe=`ifconfig | grep ppp[0-9] | awk '{print $1}'| sort -n |sed -n "$lb_count p"`
local ip=`ifconfig | grep -E 'ppp[0-9]|P-t-P' | awk '{print $3}' | grep P-t-P | head -n $lb_count | cut -d ':' -f 2 | tail -1`
cmd="${cmd} nexthop via $ip dev $pppoe weight 1 "
let lb_count+=1
done
# 开始拨号
while [ $count -lt $dial_nu ]
do
# 开始拨号
echo_date "-----------------------------------------------------------"
#echo_date "正在复制ppp$ppp_nu拨号配置文件..."
cp /tmp/ppp/options.wan0 /jffs/softcenter/configs/mdial/options.mdial$ppp_nu
sed -i "s/linkname .*/linkname mdial$ppp_nu/" /jffs/softcenter/configs/mdial/options.mdial$ppp_nu
echo_date "$(( $ppp_nu + 1 ))拨:ppp$ppp_nu开始拨号..."
/usr/sbin/pppd file /jffs/softcenter/configs/mdial/options.mdial$ppp_nu >/dev/null 2>&1
#判断拨号是否成功
local i=50
until [ -n "`ifconfig | grep ppp$ppp_nu`" ]
do
i=$(($i-1))
echo_date "等待ppp$ppp_nu拨号完成..."
usleep 200000
if [ "$i" -lt 1 ];then
echo_date "ppp$ppp_nu拨号失败..."
return 1
fi
done
if [ "$?" == "0" ];then
# 生成路由表命令
local gw_addr=$(ifconfig|grep -A 1 ppp$ppp_nu|grep -Eo 'P-t-P:([0-9]{1,3}[\.]){3}[0-9]{1,3}'|awk -F":" '{print $2}')
cmd="${cmd} nexthop via $gw_addr dev ppp$ppp_nu weight 1 "
# 添加iptables
echo_date "为ppp$ppp_nu配置防火墙..."
local ip_addr=$(ifconfig|grep -A 1 ppp$ppp_nu|grep -Eo 'inet addr:([0-9]{1,3}[\.]){3}[0-9]{1,3}'|awk -F":" '{print $2}')
local PPP_NU=$(iptables -t nat -L POSTROUTING -v -n --line-numbers|grep ppp|tail -n1|awk '{print $1}')||0
let PPP_NU+=1
iptables -t nat -I POSTROUTING $PPP_NU ! -s $ip_addr/32 -o ppp$ppp_nu -j MASQUERADE
# 拨号成功+1
let count+=1
let ppp_nu+=1
else
echo_date "停止继续拨号..."
break
fi
done
echo_date "-----------------------------------------------------------"
# 添加路由表
FINAL_DIAL_NU=`ifconfig | grep -c ppp[0-9]`
echo_date "$FINAL_DIAL_NU拨配置负载均衡..."
ip route del default
$cmd
ip route flush cache
echo_date "完成,总共完成$FINAL_DIAL_NU拨!请打开测速网站测速!"
echo_date "==========================================================="
# 拨号完毕,显示状态
# show_status
}
show_status(){
# for dbus info
echo_date "-----------------------------------------------------------"
iptables -nvL POSTROUTING -t nat
echo_date "-----------------------------------------------------------"
ps | grep pppd | grep -v grep
echo_date "-----------------------------------------------------------"
ip route show
}
stop(){
local PIDS=$(ps|grep ppp|grep -E "mdial|duobo"|awk '{print $1}')
if [ -n "$PIDS" ];then
echo_date "==========================================================="
echo_date "关闭多拨进程!"
for PID in $PIDS
do
kill -9 $PID >/dev/null 2>&1
done
fi
# 清除iptables
local nat_indexs=$(iptables -t nat -L POSTROUTING -v -n --line-numbers|grep ppp|grep -v ppp0|sort -rn|awk '{print $1}')
if [ -n "$nat_indexs" ];then
echo_date "清除iptables规则"
for nat_index in $nat_indexs
do
iptables -t nat -D POSTROUTING $nat_index >/dev/null 2>&1
done
fi
# 重建路由表
if [ -n "$(ip route show|grep weight)" ];then
echo_date "重建默认路由表"
ip route del default
ip route flush cache
echo_date "多拨成功关闭,恢复单线单拨状态!"
fi
}
case $1 in
start)
if [ "$mdial_enable" == "1" ];then
logger "[软件中心]: 启动单线多拨!"
start >> $LOG_FILE
else
logger "[软件中心]: 单线多拨未设置开机启动,跳过!"
fi
;;
stop)
stop >> $LOG_FILE
;;
esac
if [ -z "$1" ];then
if [ "$mdial_enable" == "1" ];then
start >> $LOG_FILE
else
stop >> $LOG_FILE
fi
fi

View File

@ -0,0 +1,46 @@
#!/bin/sh
timestamp=$(date +'%Y/%m/%d %H:%M:%S')
alias echo_date='echo $timestamp'
export KSROOT=/jffs/softcenter
source $KSROOT/scripts/base.sh
json_init(){
POST_DATA2='{}'
}
json_add_string(){
POST_DATA2=`echo $POST_DATA2 | jq --arg var "$2" '. + {'$1': $var}'`
}
json_dump() {
echo $POST_DATA2 | jq .
}
POST_DATA1='{}'
NU=$(ifconfig|grep ppp|awk '{print $1}'|sed 's/ppp//g')
for nu in $NU
do
local P0=$(ifconfig|grep ppp$nu -A 6)
local P1=$(echo "$P0" | grep -Eo 'ppp[0-9]')
local P2=$(echo "$P0" | grep -Eo 'inet addr:([0-9]{1,3}[\.]){3}[0-9]{1,3}'|awk -F":" '{print $2}')
local P3=$(echo "$P0" | grep -Eo 'P-t-P:([0-9]{1,3}[\.]){3}[0-9]{1,3}'|awk -F":" '{print $2}')
local P4=$(echo "$P0" | grep -Eo 'RX bytes:[0-9]+ \(.+) '|grep -Eo '\(.+)'|sed 's/[()]//g')
local P5=$(echo "$P0" | grep -Eo 'TX bytes:[0-9]+ \(.+)'|grep -Eo '\(.+)'|sed 's/[()]//g')
json_init
json_add_string if "$P1"
json_add_string ip "$P2"
json_add_string gw "$P3"
json_add_string rx "$P4"
json_add_string tx "$P5"
json_dump
POST_DATA1=`echo $POST_DATA1 | jq --argjson args "$POST_DATA2" '. + {'\"ppp$nu\"': $args}'`
done
POST_DATA1=`echo $POST_DATA1|base64_encode`
if [ -n "$NU" ]; then
echo "$POST_DATA1" > /tmp/mdial.log
else
echo "null" > /tmp/mdial.log
fi

11
mdial/mdial/uninstall.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/sh
eval `dbus export mdial_`
source /jffs/softcenter/scripts/base.sh
sh /jffs/softcenter/scripts/mdial_config.sh stop
find /jffs/softcenter/init.d/ -name "*mdial*" | xargs rm -rf
rm -rf /jffs/softcenter/res/icon-mdial.png
rm -rf /jffs/softcenter/scripts/mdial*.sh
rm -rf /jffs/softcenter/webs/Module_mdial.asp
rm -f /jffs/softcenter/scripts/uninstall_mdial.sh

View File

@ -0,0 +1,684 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache"/>
<meta HTTP-EQUIV="Expires" CONTENT="-1"/>
<link rel="shortcut icon" href="images/favicon.png"/>
<link rel="icon" href="images/favicon.png"/>
<title>单线多拨</title>
<link rel="stylesheet" type="text/css" href="index_style.css"/>
<link rel="stylesheet" type="text/css" href="form_style.css"/>
<link rel="stylesheet" type="text/css" href="usp_style.css"/>
<link rel="stylesheet" type="text/css" href="css/element.css">
<link rel="stylesheet" type="text/css" href="ParentalControl.css">
<link rel="stylesheet" type="text/css" href="css/icon.css">
<link rel="stylesheet" type="text/css" href="/device-map/device-map.css">
<script type="text/javascript" src="/state.js"></script>
<script type="text/javascript" src="/popup.js"></script>
<script type="text/javascript" src="/help.js"></script>
<script type="text/javascript" src="/validator.js"></script>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/general.js"></script>
<script type="text/javascript" src="/switcherplugin/jquery.iphone-switch.js"></script>
<script type="text/javascript" src="/res/softcenter.js"></script>
<script type="text/javascript" src="/dbconf?p=mdial&v=<% uptime(); %>"></script>
<script type="text/javascript" src="/client_function.js"></script>
<style>
.show-btn1, .show-btn2, .show-btn3 {
border: 1px solid #222;
background: linear-gradient(to bottom, #919fa4 0%, #67767d 100%); /* W3C */
/*background: linear-gradient(to bottom, #91071f 0%, #700618 100%);*/ /* W3C */
font-size:10pt;
color: #fff;
padding: 10px 3.75px;
border-radius: 5px 5px 0px 0px;
width:8.45601%;
/*border: 1px solid #91071f;*/
/*background: none;*/
}
.active {
background: #2f3a3e;
background: linear-gradient(to bottom, #61b5de 0%, #279fd9 100%); /* W3C */
/*background: linear-gradient(to bottom, #cf0a2c 0%, #91071f 100%);*/ /* W3C */
/*border: 1px solid #91071f;*/
}
.popup_bar_bg_ks{
position:fixed;
margin: auto;
top: 0;
left: 0;
width:100%;
height:100%;
z-index:99;
filter:alpha(opacity=90); /*IE5、IE5.5、IE6、IE7*/
background-repeat: repeat;
visibility:hidden;
overflow:hidden;
background-color: #444F53;*/
background:rgba(68, 79, 83, 0.9) none repeat scroll 0 0 !important;
/*background: url(/images/New_ui/login_bg.png);
background-position: 0 0;
background-size: cover;
opacity: .94;*/
}
.ss_btn {
border: 1px solid #222;
background: linear-gradient(to bottom, #003333 0%, #000000 100%); /* W3C */
/*background: linear-gradient(to bottom, #91071f 0%, #700618 100%);*/ /* W3C */
font-size:10pt;
color: #fff;
padding: 5px 5px;
border-radius: 5px 5px 5px 5px;
width:14%;
}
.ss_btn:hover {
border: 1px solid #222;
background: linear-gradient(to bottom, #27c9c9 0%, #279fd9 100%); /* W3C */
/*background: linear-gradient(to bottom, #cf0a2c 0%, #91071f 100%);*/ /* W3C */
font-size:10pt;
color: #fff;
padding: 5px 5px;
border-radius: 5px 5px 5px 5px;
width:14%;
}
textarea{
width:99%;
font-family:'Lucida Console';
font-size:12px;
color:#FFFFFF;
background:#475A5F;
/*background:transparent;*/
/*border:1px solid #91071f;*/
}
input[type=button]:focus {
outline: none;
}
</style>
<script>
var $j = jQuery.noConflict();
var dbus = {};
var _responseLen;
var noChange = 0;
var x = 5;
var wans_mode = '<% nvram_get("wans_mode"); %>'
function init() {
show_menu(menu_hook);
get_dbus_data();
buildswitch();
var rrt = document.getElementById("switch");
if (document.form.mdial_enable.value != "1") {
rrt.checked = false;
} else {
rrt.checked = true;
}
}
function E(e) {
return (typeof(e) == 'string') ? document.getElementById(e) : e;
}
var Base64;
if (typeof btoa == "Function") {
Base64 = {
encode: function(e) {
return btoa(e);
},
decode: function(e) {
return atob(e);
}
};
} else {
Base64 = {
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
encode: function(e) {
var t = "";
var n, r, i, s, o, u, a;
var f = 0;
e = Base64._utf8_encode(e);
while (f < e.length) {
n = e.charCodeAt(f++);
r = e.charCodeAt(f++);
i = e.charCodeAt(f++);
s = n >> 2;
o = (n & 3) << 4 | r >> 4;
u = (r & 15) << 2 | i >> 6;
a = i & 63;
if (isNaN(r)) {
u = a = 64
} else if (isNaN(i)) {
a = 64
}
t = t + this._keyStr.charAt(s) + this._keyStr.charAt(o) + this._keyStr.charAt(u) + this._keyStr.charAt(a)
}
return t
},
decode: function(e) {
var t = "";
var n, r, i;
var s, o, u, a;
var f = 0;
e = e.replace(/[^A-Za-z0-9\+\/\=]/g, "");
while (f < e.length) {
s = this._keyStr.indexOf(e.charAt(f++));
o = this._keyStr.indexOf(e.charAt(f++));
u = this._keyStr.indexOf(e.charAt(f++));
a = this._keyStr.indexOf(e.charAt(f++));
n = s << 2 | o >> 4;
r = (o & 15) << 4 | u >> 2;
i = (u & 3) << 6 | a;
t = t + String.fromCharCode(n);
if (u != 64) {
t = t + String.fromCharCode(r)
}
if (a != 64) {
t = t + String.fromCharCode(i)
}
}
t = Base64._utf8_decode(t);
return t
},
_utf8_encode: function(e) {
e = e.replace(/\r\n/g, "\n");
var t = "";
for (var n = 0; n < e.length; n++) {
var r = e.charCodeAt(n);
if (r < 128) {
t += String.fromCharCode(r)
} else if (r > 127 && r < 2048) {
t += String.fromCharCode(r >> 6 | 192);
t += String.fromCharCode(r & 63 | 128)
} else {
t += String.fromCharCode(r >> 12 | 224);
t += String.fromCharCode(r >> 6 & 63 | 128);
t += String.fromCharCode(r & 63 | 128)
}
}
return t
},
_utf8_decode: function(e) {
var t = "";
var n = 0;
var r = c1 = c2 = 0;
while (n < e.length) {
r = e.charCodeAt(n);
if (r < 128) {
t += String.fromCharCode(r);
n++
} else if (r > 191 && r < 224) {
c2 = e.charCodeAt(n + 1);
t += String.fromCharCode((r & 31) << 6 | c2 & 63);
n += 2
} else {
c2 = e.charCodeAt(n + 1);
c3 = e.charCodeAt(n + 2);
t += String.fromCharCode((r & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
n += 3
}
}
return t
}
}
}
function buildswitch(){
$j("#switch").click(
function(){
if(document.getElementById('switch').checked){
document.form.mdial_enable.value = 1;
}else{
document.form.mdial_enable.value = 0;
}
});
}
function get_dbus_data(){
$j.ajax({
type: "GET",
url: "dbconf?p=mdial&v=<% uptime(); %>",
dataType: "html",
cache:false,
success: function(response) {
$j.globalEval(response)
dbus = db_mdial
toggle_func();
update_visibility();
get_run_status();
set_version();
generate_options();
}
});
}
function set_version(){
if (dbus["mdial_version"]){
E('mdial_title').innerHTML = "单线多拨 - " + dbus["mdial_version"]
}
}
function generate_options(){
if(wans_mode == "lb"){
for(var i = 1; i < 3; i++) {
$j("#mdial_if").append("<option value='" + i + "'>wan" + i + "</option>");
}
$j("#mdial_if").val(1);
} else {
$j("#mdial_if").append("<option value='1'>wan0</option>");
$j("#mdial_if").val(1);
}
}
function get_run_status(){
$j.ajax({
url: 'applydb.cgi?current_page=Module_mdial.asp&next_page=Module_mdial.asp&group_id=&modified=0&action_mode=+Refresh+&action_script=mdial_status.sh&action_wait=&first_time=&preferred_lang=CN&firmver=3.0.0.4',
dataType: "html",
error: function(xhr) {
alert("error");
},
success: function(response) {
setTimeout("get_ppp_status();", 2000);
}
});
}
function get_ppp_status(){
$j.ajax({
url: '/res/mdial_check.htm',
dataType: "html",
success: function(response){
var data = JSON.parse(Base64.decode(response))
console.log(data)
$j("#script_status_table").find("tr:gt(1)").remove();
var code = ''
for (var field in data) {
var f = data[field];
code = code + '<tr>';
code = code + '<td>' + f.if + '</td>';
code = code + '<td>' + f.ip + '</td>';
code = code + '<td>' + f.gw + '</td>';
code = code + '<td>' + f.rx + '</td>';
code = code + '<td>' + f.tx + '</td>';
code = code + '</tr>';
}
$j('#script_status_table tr:last').after(code);
setTimeout("get_ppp_status();", 6000);
},
error: function(xhr){
E("script_status").innerHTML = "获取运行状态失败!";
setTimeout("get_ppp_status();", 8000);
}
});
}
function save() {
mdial_action = 0;
//showLoadingBar();
$j('.show-btn1').removeClass('active');
$j('.show-btn2').addClass('active');
$j('.show-btn3').removeClass('active');
E("mdial_settings").style.display = "none";
E("mdial_log").style.display = "";
E("mdial_help").style.display = "none";
E('cmdBtn1').style.display = "";
// 提交数据
document.form.action_mode.value = 'toolscript';
document.form.action_script.value = "mdial_config.sh";
document.form.submit();
}
function clean_log() {
document.form.action_mode.value = 'toolscript';
document.form.action_script.value = "mdial_config.sh";
document.form.submit();
$j.ajax({
url: '/applydb.cgi?p=mdial',
type: "POST",
dataType: "json",
success: function(response) {
console.log(response);
if (response.result == id){
E("log_content1").value = "";
}
}
});
}
function get_log() {
$j.ajax({
url: '/res/mdial_log.htm',
dataType: 'html',
success: function(response) {
var retArea = E("log_content1");
if (response.search("XU6J03M6") != -1) {
retArea.value = response.replace("XU6J03M6", "");
retArea.scrollTop = retArea.scrollHeight;
return true;
}
if (_responseLen == response.length) {
noChange++;
} else {
noChange = 0;
}
if (noChange > 6000) {
//retArea.value = "当前日志文件为空";
return false;
} else {
setTimeout("get_log();",200);
}
retArea.scrollTop = retArea.scrollHeight;
_responseLen = response.length;
if (retArea.value == "") {
E("log_content1").value = "暂无日志信息!";
}
},
error: function(xhr) {
//setTimeout("get_log();", 1000);
E("log_content1").value = "暂无日志信息!";
}
});
}
function count_down_close() {
if (x == "0") {
hideSSLoadingBar();
}
if (x < 0) {
E("ok_button1").value = "手动关闭"
return false;
}
E("ok_button1").value = "自动关闭(" + x + ""
--x;
setTimeout("count_down_close();", 1000);
}
function showLoadingBar() {
if (window.scrollTo)
window.scrollTo(0, 0);
disableCheckChangedStatus();
htmlbodyforIE = document.getElementsByTagName("html"); //this both for IE&FF, use "html" but not "body" because <!DOCTYPE html PUBLIC.......>
htmlbodyforIE[0].style.overflow = "hidden"; //hidden the Y-scrollbar for preventing from user scroll it.
winW_H();
var blockmarginTop;
var blockmarginLeft;
if (window.innerWidth)
winWidth = window.innerWidth;
else if ((document.body) && (document.body.clientWidth))
winWidth = document.body.clientWidth;
if (window.innerHeight)
winHeight = window.innerHeight;
else if ((document.body) && (document.body.clientHeight))
winHeight = document.body.clientHeight;
if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth) {
winHeight = document.documentElement.clientHeight;
winWidth = document.documentElement.clientWidth;
}
if (winWidth > 1050) {
winPadding = (winWidth - 1050) / 2;
winWidth = 1105;
blockmarginLeft = (winWidth * 0.3) + winPadding - 150;
} else if (winWidth <= 1050) {
blockmarginLeft = (winWidth) * 0.3 + document.body.scrollLeft - 160;
}
if (winHeight > 660)
winHeight = 660;
blockmarginTop = winHeight * 0.3 - 140
E("loadingBarBlock").style.marginTop = blockmarginTop + "px";
E("loadingBarBlock").style.marginLeft = blockmarginLeft + "px";
E("loadingBarBlock").style.width = 770 + "px";
E("LoadingBar").style.width = winW + "px";
E("LoadingBar").style.height = winH + "px";
LoadingProgress();
}
function LoadingProgress() {
E("LoadingBar").style.visibility = "visible";
if (mdial_action == 0) {
if(E("switch").checked ? '1' : '0' == "1"){
E("loading_block3").innerHTML = "单线多拨启用中 ..."
}else{
E("loading_block3").innerHTML = "单线多拨关闭中 ..."
}
} else if (mdial_action == 1) {
E("loading_block3").innerHTML = "mdial配置恢复 ..."
}
$j("#loading_block2").html("<li><font color='#ffcc00'>插件工作有问题?请到我们的论坛 <a href='http://koolshare.cn/forum-98-1.html' target='_blank'><u><em>http://koolshare.cn</em></u></a> 反馈...</li></font>");
}
function hideSSLoadingBar() {
x = -1;
E("LoadingBar").style.visibility = "hidden";
refreshpage();
}
function toggle_func() {
$j('.show-btn1').addClass('active');
$j(".show-btn1").click(
function() {
$j('.show-btn1').addClass('active');
$j('.show-btn2').removeClass('active');
$j('.show-btn3').removeClass('active');
E("mdial_settings").style.display = "";
E("mdial_log").style.display = "none";
E("mdial_help").style.display = "none";
E('cmdBtn1').style.display = "none";
});
$j(".show-btn2").click(
function() {
$j('.show-btn1').removeClass('active');
$j('.show-btn2').addClass('active');
$j('.show-btn3').removeClass('active');
E("mdial_settings").style.display = "none";
E("mdial_log").style.display = "";
E("mdial_help").style.display = "none";
E('cmdBtn1').style.display = "";
get_log();
});
$j(".show-btn3").click(
function() {
$j('.show-btn1').removeClass('active');
$j('.show-btn2').removeClass('active');
$j('.show-btn3').addClass('active');
E("mdial_settings").style.display = "none";
E("mdial_log").style.display = "none";
E("mdial_help").style.display = "";
E('cmdBtn1').style.display = "none";
});
$j("#log_content2").click(
function() {
x = -1;
});
}
function update_visibility(){
if($j('.show-btn1').hasClass("active")){
E('mdial_status').style.display = "";
E('tablet_show').style.display = "";
E('mdial_settings').style.display = "";
E('mdial_log').style.display = "none";
E('mdial_help').style.display = "none";
E('cmdBtn1').style.display = "none";
}else if($j('.show-btn2').hasClass("active")){
E('mdial_status').style.display = "";
E('tablet_show').style.display = "";
E('mdial_settings').style.display = "none";
E('mdial_log').style.display = "";
E('mdial_help').style.display = "none";
E('cmdBtn1').style.display = "";
}else if($j('.show-btn3').hasClass("active")){
E('mdial_status').style.display = "";
E('tablet_show').style.display = "";
E('mdial_settings').style.display = "none";
E('mdial_log').style.display = "none";
E('mdial_help').style.display = "";
E('cmdBtn1').style.display = "none";
}
}
function menu_hook(title, tab) {
tabtitle[tabtitle.length -1] = new Array("", "软件中心", "离线安装", "单线多拨");
tablink[tablink.length -1] = new Array("", "Main_Soft_center.asp", "Main_Soft_setting.asp", "Module_mdial.asp");
}
function reload_Soft_Center(){
location.href = "/Main_Soft_center.asp";
}
</script>
</head>
<body onload="init();">
<div id="TopBanner"></div>
<div id="Loading" class="popup_bg"></div>
<div id="LoadingBar" class="popup_bar_bg_ks" style="z-index: 200;" >
<table cellpadding="5" cellspacing="0" id="loadingBarBlock" class="loadingBarBlock" align="center">
<tr>
<td height="100">
<div id="loading_block3" style="margin:10px auto;margin-left:10px;width:85%; font-size:12pt;"></div>
<div id="loading_block2" style="margin:10px auto;width:95%;"></div>
<div id="log_content2" style="margin-left:15px;margin-right:15px;margin-top:10px;overflow:hidden">
<textarea cols="50" rows="36" wrap="off" readonly="readonly" id="log_content3" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" style="border:1px solid #000;width:99%; font-family:'Lucida Console'; font-size:11px;background:transparent;color:#FFFFFF;outline: none;padding-left:3px;padding-right:22px;overflow-x:hidden"></textarea>
</div>
<div id="ok_button" class="apply_gen" style="background: #000;display: none;">
<input id="ok_button1" class="button_gen" type="button" onclick="hideSSLoadingBar()" value="确定">
</div>
</td>
</tr>
</table>
</div>
<iframe name="hidden_frame" id="hidden_frame" src="" width="0" height="0" frameborder="0"></iframe>
<form method="POST" name="form" action="/applydb.cgi?p=mdial" target="hidden_frame">
<input type="hidden" name="current_page" value="Module_mdial.asp"/>
<input type="hidden" name="next_page" value="Module_mdial.asp"/>
<input type="hidden" name="group_id" value=""/>
<input type="hidden" name="modified" value="0"/>
<input type="hidden" name="action_mode" value=" Refresh "/>
<input type="hidden" name="action_script" value="mdial_config.sh"/>
<input type="hidden" name="action_wait" value="5"/>
<input type="hidden" name="first_time" value=""/>
<input type="hidden" name="mdial_enable" value="<% dbus_get_def("mdial_enable", "0"); %>"/>
<input type="hidden" name="mdial_nu" value="<% dbus_get_def("mdial_nu", "4"); %>"/>
<input type="hidden" name="preferred_lang" id="preferred_lang" value="<% nvram_get("preferred_lang"); %>"/>
<input type="hidden" name="firmver" value="<% nvram_get("firmver"); %>"/>
<table class="content" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="17">&nbsp;</td>
<td valign="top" width="202">
<div id="mainMenu"></div>
<div id="subMenu"></div>
</td>
<td valign="top">
<div id="tabMenu" class="submenuBlock"></div>
<table width="98%" border="0" align="left" cellpadding="0" cellspacing="0" style="display: block;">
<tr>
<td align="left" valign="top">
<div>
<table width="760px" border="0" cellpadding="5" cellspacing="0" bordercolor="#6b8fa3" class="FormTitle" id="FormTitle">
<tr>
<td bgcolor="#4D595D" colspan="3" valign="top">
<div>&nbsp;</div>
<div id="mdial_title" style="float:left;" class="formfonttitle" style="padding-top: 12px">单线多拨</div>
<div style="float:right; width:15px; height:25px;margin-top:10px"><img id="return_btn" onclick="reload_Soft_Center();" align="right" style="cursor:pointer;position:absolute;margin-left:-30px;margin-top:-25px;" title="返回软件中心" src="/images/backprev.png" onMouseOver="this.src='/images/backprevclick.png'" onMouseOut="this.src='/images/backprev.png'"></img></div>
<div style="margin:30px 0 10px 5px;" class="splitLine"></div>
<div class="SimpleNote" id="head_illustrate"><i></i><em>pppoe单线多拨插件自动负载均衡网络提速利器</em></div>
<div id="mdial_switch" style="margin:0px 0px 0px 0px;">
<table style="margin:-1px 0px 0px 0px;" width="100%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#6b8fa3" class="FormTable">
<thead>
<tr>
<td colspan="2">单线多拨 - 开关</td>
</tr>
</thead>
<tr id="switch_tr">
<th>
<label>开启单线多拨</label>
</th>
<td colspan="2">
<div class="switch_field" style="display:table-cell">
<label for="switch">
<input id="switch" class="switch" type="checkbox" style="display: none;">
<div class="switch_container" >
<div class="switch_bar"></div>
<div class="switch_circle transition_style">
<div></div>
</div>
</div>
</label>
</div>
<div style="display:table-cell;float: left;margin-left:270px;margin-top:-32px;position: absolute;padding: 5.5px 0px;">
<a type="button" class="ss_btn" target="_blank" href="https://github.com/koolshare/rogsoft/blob/master/mdial/Changelog.txt">更新日志</a>
</div>
</td>
</tr>
</table>
</div>
<div id="mdial_status" style="margin:10px 0px 0px 0px;">
<table id="script_status_table" style="margin:-1px 0px 0px 0px;" width="100%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#6b8fa3" class="FormTable">
<thead>
<tr>
<td colspan="5">单线多拨 - 状态</td>
</tr>
</thead>
<tr>
<th style="width:20%">接口</th>
<th style="width:20%">IP</th>
<th style="width:20%">网关</th>
<th style="width:20%">下行</th>
<th style="width:20%">上行</th>
</tr>
<tr>
<span id="script_status"></span>
</tr>
</table>
</div>
<div id="tablet_show">
<table style="margin:10px 0px 0px 0px;border-collapse:collapse" width="100%" height="37px">
<tr width="235px">
<td colspan="4" cellpadding="0" cellspacing="0" style="padding:0" border="1" bordercolor="#000">
<input id="show_btn1" class="show-btn1" style="cursor:pointer" type="button" value="基本设置"/>
<input id="show_btn2" class="show-btn2" style="cursor:pointer" type="button" value="查看日志"/>
<input id="show_btn3" class="show-btn3" style="cursor:pointer" type="button" value="帮助信息"/>
</td>
</tr>
</table>
</div>
<div id="mdial_settings" style="margin:-1px 0px 0px 0px;">
<table style="margin:-1px 0px 0px 0px;" width="100%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#6b8fa3" class="FormTable">
<tr id="mdial_if_tr">
<th>多拨数量</th>
<td>
<select id="mdial_if" name="mdial_if" class="ssconfig input_option" >
</select>
<input type="text" class="input_ss_table" name="mdial_nu" id="mdial_nu" style="width:80px" value="<% dbus_get("mdial_nu"); %>" />
</td>
</tr>
<tr>
<th>速度测试</th>
<td>
<a type="button" class="ss_btn" target="_blank" href="http://www.speedtest.net">http://www.speedtest.net</a>
</td>
</tr>
</table>
</div>
<div id="mdial_log" style="margin:-1px 0px 0px 0px;display: none;">
<div id="log_content" style="margin-top:-1px;display:block;overflow:hidden;">
<textarea cols="63" rows="36" wrap="on" readonly="readonly" id="log_content1" style="margin-top:-1px;width:97%; padding-left:4px;padding-right:37px;border:0px solid #222;font-family:'Lucida Console';font-size:11px;color:#FFFFFF;outline:none;overflow-x:hidden;" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
</div>
</div>
<div id="mdial_help" style="margin:-1px 0px 0px 0px;display: none;">
<table style="margin:-1px 0px 0px 0px;" width="100%" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#6b8fa3" class="FormTable">
<tr>
<td>
<ul>
<li>注意本插件仅适用于蓝洞固件和K3C固件</li>
<li>多拨插件需要光猫桥接由路由器来进行pppoe拨号。</li>
<li>不是所有运营商都能多拨!也不是所有多拨都能叠加!</li>
<li>本插件的维护地址在<a href="https://github.com/koolshare/rogsoft" target="_blank" ><i><u>https://github.com/koolshare/rogsoft</u></i></a>,欢迎到此反馈问题!</li>
</ul>
</td>
</tr>
</table>
</div>
<div class="apply_gen">
<button id="cmdBtn" class="button_gen" onclick="save()">提交</button>
<button id="cmdBtn1" class="button_gen" onclick="clean_log()">清空日志</button>
</div>
<div class="KoolshareBottom">
论坛技术支持: <a href="http://www.koolshare.cn" target="_blank"> <i><u>www.koolshare.cn</u></i> </a> <br/>
Github项目 <a href="https://github.com/koolshare/rogsoft" target="_blank"> <i><u>github.com/koolshare/rogsoft</u></i> </a> <br/>
Shell&Web by <i>sadog</i>
</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div id="footer"></div>
</body>
</html>

2
mdial/version Normal file
View File

@ -0,0 +1,2 @@
1.3
becd45a122614c2c2290c66aa11332d1

View File

@ -100,6 +100,16 @@
"title": "kms",
"version": "1.5"
},
{
"build_date": "2019-02-12_18:38:27",
"description": "dc1服务器",
"home_url": "Module_dc1svr.asp",
"md5": "7bab90695d4d9b38a03bc15aa2b20637",
"name": "dc1svr",
"tar_url": "dc1svr/dc1svr.tar.gz",
"title": "dc1服务器",
"version": "1.0"
},
{
"build_date": "2019-01-16_20:13:34",
"description": "内网穿透利器,谁用谁知道。",
@ -120,6 +130,16 @@
"title": "aliddns",
"version": "1.2"
},
{
"build_date": "2019-01-23_18:38:39",
"description": "pppoe单线多拨带宽提升神器",
"home_url": "Module_mdial.asp",
"md5": "becd45a122614c2c2290c66aa11332d1",
"name": "mdial",
"tar_url": "mdial/mdial.tar.gz",
"title": "单线多拨",
"version": "1.3"
},
{
"build_date": "2019-01-17_00:07:34",
"description": "使用Dnspod的ddns服务",
@ -130,6 +150,16 @@
"title": "DDnspod",
"version": "0.1.6"
},
{
"build_date": "2019-02-04_20:27:44",
"description": "v2ray",
"home_url": "Module_v2ray.asp",
"md5": "72a421802e093e7cc52d89c8e05a5bbf",
"name": "v2ray",
"tar_url": "v2ray/v2ray.tar.gz",
"title": "v2ray",
"version": "4.13.0"
},
{
"build_date": "2019-01-30_19:23:59",
"description": "Intel CPU频率设置",
@ -142,7 +172,7 @@
}
],
"home_url": "https://raw.githubusercontent.com/paldier/softcenter/master",
"md5": "457899c20692885a54165d0764269530",
"md5": "d374aef1bf1c4a5511ae45c457f4a852",
"tar_url": "softcenter/softcenter.tar.gz",
"version": "1.1.6"
"version": "1.1.7"
}

View File

@ -1,4 +1,4 @@
{
"version":"1.1.6",
"md5":"457899c20692885a54165d0764269530"
"version":"1.1.7",
"md5":"d374aef1bf1c4a5511ae45c457f4a852"
}

View File

@ -31,7 +31,7 @@ def work_paths_by_walk():
print os.path.join(root,sub)
def work_parent():
ignore_paths = frozenset(["maintain_files", "softcenter", "v2ray", "adbyby", "gdddns", "mdial", "rules", "v2ray_binary"])
ignore_paths = frozenset(["maintain_files", "softcenter", "adbyby", "gdddns", "rules", "v2ray_binary"])
for fname in os.listdir(parent_path):
if fname[0] == "." or fname in ignore_paths:

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -1,2 +1,2 @@
1.1.6
457899c20692885a54165d0764269530
1.1.7
d374aef1bf1c4a5511ae45c457f4a852