The response has been limited to 50k tokens of the smallest files in the repo. You can remove this limitation by removing the max tokens filter.
├── .github
    └── issue_template.md
├── .gitignore
├── .gitmodules
├── 404.html
├── README.md
├── appledns
    ├── Changelog.txt
    ├── README.md
    ├── appledns.tar.gz
    ├── appledns
    │   ├── appledns
    │   │   ├── appstore
    │   │   ├── cmc.json
    │   │   ├── cnc.json
    │   │   └── tel.json
    │   ├── install.sh
    │   ├── res
    │   │   └── icon-appledns.png
    │   ├── scripts
    │   │   └── appledns.sh
    │   ├── uninstall.sh
    │   └── webs
    │   │   └── Module_appledns.asp
    ├── backup.sh
    ├── build.sh
    ├── config.json.js
    ├── history
    │   ├── 0.2
    │   │   └── appledns.tar.gz
    │   └── version
    └── version
├── ddnspod
    ├── Changelog.txt
    ├── backup.sh
    ├── build.sh
    ├── config.json.js
    ├── ddnspod.tar.gz
    ├── ddnspod
    │   ├── ddnspod
    │   │   └── ddnspod.sh
    │   ├── init.d
    │   │   └── S99ddnspod.sh
    │   ├── install.sh
    │   ├── res
    │   │   ├── icon-ddnspod.png
    │   │   ├── md5.js
    │   │   ├── rsa.js
    │   │   └── sha1.js
    │   ├── scripts
    │   │   └── ddnspod_config.sh
    │   ├── uninstall.sh
    │   └── webs
    │   │   └── Module_ddnspod.asp
    ├── history
    │   ├── 0.1.6
    │   │   └── ddnspod.tar.gz
    │   ├── 0.1.7
    │   │   └── ddnspod.tar.gz
    │   └── version
    └── version
├── dualwan
    ├── Changelog.txt
    ├── README.md
    ├── backup.sh
    ├── build.sh
    ├── config.json.js
    ├── dualwan.tar.gz
    ├── dualwan
    │   ├── dw
    │   │   ├── cmc.txt
    │   │   ├── cnc.txt
    │   │   ├── cnn.txt
    │   │   ├── crc.txt
    │   │   └── tel.txt
    │   ├── install.sh
    │   ├── res
    │   │   └── icon-dualwan.png
    │   ├── scripts
    │   │   └── dualwan_policy.sh
    │   ├── uninstall.sh
    │   └── webs
    │   │   └── Module_policy_route.asp
    ├── history
    │   ├── 2.0
    │   │   └── dualwan.tar.gz
    │   ├── 2.1
    │   │   └── dualwan.tar.gz
    │   ├── 2.2
    │   │   └── dualwan.tar.gz
    │   └── version
    └── version
├── favicon.ico
├── index.html
├── koolnet
    ├── backup.sh
    ├── build.sh
    ├── config.json.js
    ├── history
    │   ├── 0.2
    │   │   └── koolnet.tar.gz
    │   └── version
    ├── koolnet.tar.gz
    ├── koolnet
    │   ├── bin
    │   │   └── koolnet
    │   ├── init.d
    │   │   └── S90koolnet.sh
    │   ├── install.sh
    │   ├── res
    │   │   └── icon-koolnet.png
    │   ├── scripts
    │   │   └── config-koolnet.sh
    │   ├── uninstall.sh
    │   └── webs
    │   │   └── Module_koolnet.asp
    ├── version
    └── windows.zip
├── kuainiao
    ├── Changelog.txt
    ├── backup.sh
    ├── build.sh
    ├── config.json.js
    ├── history
    │   ├── 0.3.6
    │   │   └── kuainiao.tar.gz
    │   └── version
    ├── kuainiao.tar.gz
    ├── kuainiao
    │   ├── install.sh
    │   ├── kuainiao
    │   │   └── kuainiao.sh
    │   ├── res
    │   │   ├── icon-kuainiao.png
    │   │   ├── md5.js
    │   │   ├── rsa.js
    │   │   └── sha1.js
    │   ├── scripts
    │   │   └── kuainiao_config.sh
    │   └── webs
    │   │   └── Module_kuainiao.asp
    └── version
├── phddns
    ├── backup.sh
    ├── build.sh
    ├── config.json.js
    ├── history
    │   ├── 0.2
    │   │   └── phddns.tar.gz
    │   └── version
    ├── phddns.tar.gz
    ├── phddns
    │   ├── init.d
    │   │   └── S60phddns.sh
    │   ├── install.sh
    │   ├── phddns
    │   │   ├── oraynewph
    │   │   ├── oraysl
    │   │   └── phddns_daemon.sh
    │   ├── res
    │   │   └── icon-phddns.png
    │   ├── scripts
    │   │   ├── phddns_config.sh
    │   │   ├── phddns_run.sh
    │   │   └── phddns_uninstall.sh
    │   └── webs
    │   │   └── Module_phddns.asp
    └── version
├── shadowvpn
    ├── Changelog.txt
    ├── backup.sh
    ├── build.sh
    ├── config.json.js
    ├── history
    │   ├── 2.9
    │   │   └── shadowvpn.tar.gz
    │   ├── 3.0
    │   │   └── shadowvpn.tar.gz
    │   └── version
    ├── shadowvpn.tar.gz
    ├── shadowvpn
    │   ├── bin
    │   │   ├── shadowvpn
    │   │   └── speederv2
    │   ├── dnsmasq.d
    │   │   └── ps.conf
    │   ├── install.sh
    │   ├── res
    │   │   └── icon-shadowvpn.png
    │   ├── scripts
    │   │   ├── shadowvpn.sh
    │   │   ├── shadowvpn_client_down.sh
    │   │   └── shadowvpn_client_up.sh
    │   ├── uninstall.sh
    │   └── webs
    │   │   └── Module_shadowvpn.asp
    └── version
├── shellinabox
    ├── Changelog.txt
    ├── backup.sh
    ├── build.sh
    ├── config.json.js
    ├── history
    │   ├── 1.7
    │   │   └── shellinabox.tar.gz
    │   ├── 1.8
    │   │   └── shellinabox.tar.gz
    │   ├── 1.9
    │   │   └── shellinabox.tar.gz
    │   ├── 2.0
    │   │   └── shellinabox.tar.gz
    │   └── version
    ├── shellinabox.tar.gz
    ├── shellinabox
    │   ├── install.sh
    │   ├── res
    │   │   └── icon-shellinabox.png
    │   ├── shellinabox
    │   │   ├── shellinabox_start.sh
    │   │   ├── shellinaboxd
    │   │   └── white-on-black.css
    │   └── webs
    │   │   └── Module_shellinabox.asp
    └── version
├── softcenter
    ├── Changelog.txt
    ├── README.md
    ├── app.json.js
    ├── app.template.json.js
    ├── build.sh
    ├── build_base.sh
    ├── config.json.js
    ├── gen_install.py
    ├── index.html
    ├── modules.json
    ├── push_message.json.js
    ├── softcenter.tar.gz
    ├── softcenter
    │   ├── bin
    │   │   ├── curl
    │   │   ├── helper.sh
    │   │   ├── koolbox
    │   │   ├── perpboot
    │   │   ├── perpctl
    │   │   ├── perpd
    │   │   ├── perphup
    │   │   ├── perpls
    │   │   ├── perpok
    │   │   ├── perpstat
    │   │   ├── sissylog
    │   │   ├── tinylog
    │   │   └── wget
    │   ├── init.d
    │   │   └── S01Skipd.sh
    │   ├── install.sh
    │   ├── perp
    │   │   ├── .boot
    │   │   │   ├── rc.log
    │   │   │   └── rc.perp
    │   │   ├── .control
    │   │   │   └── perpd.pid
    │   │   └── perp.sh
    │   ├── res
    │   │   ├── Softerware_center.css
    │   │   ├── all.png
    │   │   ├── chn.png
    │   │   ├── game.png
    │   │   ├── gameV2.png
    │   │   ├── gfw.png
    │   │   ├── icon-acme.png
    │   │   ├── icon-adm.png
    │   │   ├── icon-aliddns.png
    │   │   ├── icon-appledns.png
    │   │   ├── icon-aria2.png
    │   │   ├── icon-cloudxns.png
    │   │   ├── icon-ddnspod.png
    │   │   ├── icon-ddnsto.png
    │   │   ├── icon-default.png
    │   │   ├── icon-dualwan.png
    │   │   ├── icon-easyexplorer.png
    │   │   ├── icon-entware.png
    │   │   ├── icon-frpc.png
    │   │   ├── icon-frps.png
    │   │   ├── icon-gdddns.png
    │   │   ├── icon-kcptun.png
    │   │   ├── icon-kms.png
    │   │   ├── icon-koolnet.png
    │   │   ├── icon-kuainiao.png
    │   │   ├── icon-phddns.png
    │   │   ├── icon-qiandao.png
    │   │   ├── icon-serverchan.png
    │   │   ├── icon-shadowsocks.png
    │   │   ├── icon-shadowvpn.png
    │   │   ├── icon-shell.png
    │   │   ├── icon-shellinabox.png
    │   │   ├── icon-softether.png
    │   │   ├── icon-speedtest.png
    │   │   ├── icon-ssid.png
    │   │   ├── icon-ssserver.png
    │   │   ├── icon-swap.png
    │   │   ├── icon-thunder.png
    │   │   ├── icon-transmission.png
    │   │   ├── icon-tunnel.png
    │   │   ├── icon-v2ray.png
    │   │   ├── icon-webshell.png
    │   │   ├── koolshare.png
    │   │   ├── md5.js
    │   │   ├── rsa.js
    │   │   ├── sha1.js
    │   │   ├── softcenter.js
    │   │   └── upgrade.png
    │   ├── scripts
    │   │   ├── ks_app_install.sh
    │   │   ├── ks_app_remove.sh
    │   │   └── ks_tar_install.sh
    │   └── webs
    │   │   ├── Main_Soft_center.asp
    │   │   └── Main_Soft_setting.asp
    ├── sync.py
    ├── tests
    │   ├── test_app.sh
    │   ├── test_app_one.sh
    │   └── test_app_remove.sh
    └── version
├── speedtest
    ├── Changelog.txt
    ├── README.md
    ├── backup.sh
    ├── build.sh
    ├── config.json.js
    ├── history
    │   ├── 0.2.2
    │   │   └── speedtest.tar.gz
    │   └── version
    ├── speedtest.tar.gz
    ├── speedtest
    │   ├── bin
    │   │   └── speedtest
    │   ├── install.sh
    │   ├── res
    │   │   └── icon-speedtest.png
    │   ├── scripts
    │   │   ├── speedtest_config.sh
    │   │   └── speedtest_uninstall.sh
    │   └── webs
    │   │   └── Module_speedtest.asp
    └── version
├── ssid
    ├── backup.sh
    ├── build.sh
    ├── config.json.js
    ├── history
    │   ├── 1.3
    │   │   └── ssid.tar.gz
    │   └── version
    ├── ssid.tar.gz
    ├── ssid
    │   ├── init.d
    │   │   └── S92ssid.sh
    │   ├── install.sh
    │   ├── res
    │   │   └── icon-ssid.png
    │   ├── scripts
    │   │   ├── .tar.gz
    │   │   ├── ssid_config.sh
    │   │   └── ssid_uninstall.sh
    │   ├── ssid
    │   │   └── ssid.sh
    │   └── webs
    │   │   └── Module_ssid.asp
    └── version
└── swap
    ├── backup.sh
    ├── build.sh
    ├── config.json.js
    ├── history
        ├── 2.2
        │   └── swap.tar.gz
        └── version
    ├── swap.tar.gz
    ├── swap
        ├── install.sh
        ├── res
        │   └── icon-swap.png
        ├── scripts
        │   ├── swap_check.sh
        │   ├── swap_load.sh
        │   ├── swap_startup.sh
        │   └── swap_unload.sh
        ├── swap
        │   └── swap.sh
        └── webs
        │   └── Module_swap.asp
    └── version


/.github/issue_template.md:
--------------------------------------------------------------------------------
 1 | 提交issue请先回答以下问题,以便我们更快的找到问题,多谢配合(本行和以下括号内的内容可以删除)~
 2 | 
 3 | #### 你使用的路由器型号、固件版本?
 4 | ##### 路由型号:
 5 | ##### 固件版本:
 6 | 
 7 | #### 你遇到问题的是什么插件?
 8 | ##### 插件名称:
 9 | ##### 插件版本:
10 | 
11 | #### 使用这个插件你遇到了什么问题(尽量详细描述)?
12 | ##### 问题描述:
13 | 
14 | #### 插件具体设置(请尽量提供以下信息,如果截图或者关键信息,请打码或者更改)?
15 | ##### 插件设置截图:
16 | ##### 插件配置文件:
17 | ##### 插件运行日志:
18 | ##### 关键系统日志:
19 | ##### 其它信息(如果有):
20 | 


--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | softcenter/to_remove.txt
2 | tunnel
3 | .lconfig.json.js
4 | .htaccess
5 | .user.ini
6 | 


--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "aria2/aria2/www/glutton"]
2 | 	path = aria2/aria2/www/glutton
3 | 	url = https://github.com/NemoAlex/glutton.git
4 | 


--------------------------------------------------------------------------------
/404.html:
--------------------------------------------------------------------------------
 1 | <html>
 2 | <head>
 3 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 4 | <meta name="KoolshareMonitor" content="KoolshareMonitor Tag">
 5 | <title>404 Not Found</title>
 6 | <style type="text/css">
 7 | <!--
 8 | .t {
 9 |         font-family: Verdana, Arial, Helvetica, sans-serif;
10 |         color: #CC0000;
11 | }
12 | .c {
13 |         font-family: Verdana, Arial, Helvetica, sans-serif;
14 |         font-size: 11px;
15 |         font-weight: normal;
16 |         color: #000000;
17 |         line-height: 18px;
18 |         text-align: center;
19 |         border: 1px solid #CCCCCC;
20 |         background-color: #FFFFEC;
21 | }
22 | body {
23 |         background-color: #FFFFFF;
24 |         margin-top: 100px;
25 | }
26 | -->
27 | </style>
28 | </head>
29 | <body>
30 | <div align="center">
31 |   <h2><span class="t">404 Not Found</span></h2>
32 |   <table border="0" cellpadding="8" cellspacing="0" width="460">
33 |     <tbody>
34 |       <tr>
35 |         <td class="c">The requested URL was not found on this server.</td>
36 |       </tr>
37 |     </tbody>
38 |   </table>
39 | </div>
40 | </body>
41 | </html>


--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
 1 | 小宝开源插件
 2 | =========
 3 | 
 4 | 目前仅支持小宝改版本的 Merlin 固件的插件。未来有望支持 Tomato/Ddwrt 等 arm 系列路由器的插件而成为类似 Entware 可以让大家安装并且有配置界面的插件列表。目前还远远达不到我们心中的设计目标,时间有限,只能一跳一跳的去完成,希望能有更多兄弟参与。
 5 | 
 6 | 插件支持列表
 7 | ========
 8 | * 穿透 DDNS [查看介绍](http://koolshare.cn/thread-123567-1-1.html)
 9 | * P2P 远程文件管理 + 流媒体支持 [查看介绍](http://koolshare.cn/thread-129199-1-1.html)
10 | * 讯雷下载
11 | * Aria2 下载
12 | * 讯雷快鸟
13 | * KoolProxy 家长控制 [查看介绍](http://koolshare.cn/thread-64086-1-1.html)
14 | * 策略路由
15 | * WebShell
16 | * 远程消息通知
17 | * Alidns + ddnspod + gddns
18 | 
19 | 存储核心
20 | =======
21 | * Skipdbv2 [项目地址](https://github.com/koolshare/skipdbv2)
22 | 
23 | 开发与调试方式
24 | ======
25 | * 最好在 linux 环境下进行开发
26 | * TODO
27 | 
28 | 感谢人员
29 | ======
30 | * 排名不分先后
31 | * TODO
32 | 
33 | 交流场地
34 | ======
35 | * 目前我们在 [Koolshare 论坛](http://koolshare.cn/forum.php)
36 | 
37 | 


--------------------------------------------------------------------------------
/appledns/Changelog.txt:
--------------------------------------------------------------------------------
1 | Koolshare Asuswrt-Merlin AppleDNS Changelog
2 | ===========================================
3 | 0.1 (13/5/2015 15:10:00)
4 |    - ADD:	add AppleDNS for Merlin Koolshare firmware Softerware center
5 | 0.2 (13/5/2015 15:10:00)
6 |    - FIX:	fix bugs
7 | 


--------------------------------------------------------------------------------
/appledns/README.md:
--------------------------------------------------------------------------------
1 | # 小宝改版固件AppleDNS加速服务插件
2 | 


--------------------------------------------------------------------------------
/appledns/appledns.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/appledns/appledns.tar.gz


--------------------------------------------------------------------------------
/appledns/appledns/appledns/cmc.json:
--------------------------------------------------------------------------------
 1 | [
 2 |     {
 3 |         "title": "API-1-ChinaNetCenter",
 4 |         "domains": [
 5 |             "se.itunes.apple.com",
 6 |             "su.itunes.apple.com",
 7 |             "upp.itunes.apple.com",
 8 |             "play.itunes.apple.com",
 9 |             "client-api.itunes.apple.com"
10 |         ],
11 |         "ips": {
12 |             "CMCC": [
13 |                 "111.1.33.238:443",
14 |                 "111.11.31.83:443",
15 |                 "111.44.244.49:443",
16 |                 "112.17.26.99:443",
17 |                 "112.25.35.17:443",
18 |                 "112.29.150.173:443",
19 |                 "117.172.21.13:443",
20 |                 "117.187.19.158:443",
21 |                 "120.209.141.70:443",
22 |                 "120.209.142.59:443",
23 |                 "183.222.99.114:443",
24 |                 "218.202.111.167:443"
25 |             ]
26 |         }
27 |     },
28 |     {
29 |         "title": "API-HK-Akamai-1",
30 |         "domains": [
31 |             "search.itunes.apple.com"
32 |         ],
33 |         "ips": {
34 |             "HongKong0": [
35 |                 "23.42.189.88:443",
36 |                 "23.50.17.214:443",
37 |                 "23.198.133.66:443",
38 |                 "60.254.170.217:443",
39 |                 "104.114.184.38:443",
40 |                 "184.87.97.50:443"
41 |             ]
42 |         }
43 |     },
44 |     {
45 |         "title": "API-HK2-AMRadio",
46 |         "domains": [
47 |             "radio.itunes.apple.com",
48 |             "radio-activity.itunes.apple.com",
49 |             "radio-services.itunes.apple.com"
50 |         ],
51 |         "ips": {
52 |             "HongKong1": [
53 |                 "23.13.185.169:443",
54 |                 "104.89.141.101:443",
55 |                 "184.87.100.246:443"
56 |             ]
57 |         }
58 |     }
59 | ]


--------------------------------------------------------------------------------
/appledns/appledns/appledns/cnc.json:
--------------------------------------------------------------------------------
  1 | [
  2 |     {
  3 |         "title": "API-1-ChinaNetCenter",
  4 |         "domains": [
  5 |             "se.itunes.apple.com",
  6 |             "su.itunes.apple.com",
  7 |             "upp.itunes.apple.com",
  8 |             "play.itunes.apple.com",
  9 |             "client-api.itunes.apple.com"
 10 |         ],
 11 |         "ips": {
 12 |             "ChinaUnicom": [
 13 |                 "36.248.11.14:443",
 14 |                 "42.48.110.14:443",
 15 |                 "60.28.160.45:443",
 16 |                 "60.211.209.143:443",
 17 |                 "60.212.19.12:443",
 18 |                 "60.217.23.15:443",
 19 |                 "61.54.12.140:443",
 20 |                 "61.54.219.50:443",
 21 |                 "61.156.243.59:443",
 22 |                 "101.23.128.36:443",
 23 |                 "101.26.37.123:443",
 24 |                 "110.18.244.68:443",
 25 |                 "112.90.240.7:443",
 26 |                 "121.18.230.160:443",
 27 |                 "122.143.23.46:443",
 28 |                 "123.133.76.14:443",
 29 |                 "123.138.61.6:443",
 30 |                 "124.161.207.84:443",
 31 |                 "125.39.1.142:443",
 32 |                 "139.209.90.65:443",
 33 |                 "163.177.171.51:443",
 34 |                 "171.15.199.35:443",
 35 |                 "175.43.120.12:443",
 36 |                 "175.173.245.15:443",
 37 |                 "218.29.50.51:443",
 38 |                 "218.59.186.105:443",
 39 |                 "218.59.213.135:443",
 40 |                 "218.61.193.70:443",
 41 |                 "220.194.203.60:443",
 42 |                 "221.13.201.135:443",
 43 |                 "221.193.246.61:443",
 44 |                 "221.202.205.15:443",
 45 |                 "221.206.120.70:443",
 46 |                 "222.132.6.15:443"
 47 |             ]
 48 |         }
 49 |     },
 50 |     {
 51 |         "title": "API-2-ChinaCache",
 52 |         "domains": [
 53 |             "itunes.apple.com",
 54 |             "init.itunes.apple.com"
 55 |         ],
 56 |         "ips": {
 57 |             "ChinaUnicom": [
 58 |                 "27.221.54.135:443",
 59 |                 "60.6.197.202:443",
 60 |                 "60.31.194.14:443",
 61 |                 "61.240.136.68:443",
 62 |                 "61.240.136.71:443",
 63 |                 "101.26.38.32:443",
 64 |                 "101.26.38.33:443",
 65 |                 "111.202.73.180:443",
 66 |                 "112.90.90.5:443",
 67 |                 "112.90.90.17:443",
 68 |                 "112.90.90.156:443",
 69 |                 "112.90.147.150:443",
 70 |                 "112.90.147.151:443",
 71 |                 "112.90.147.152:443",
 72 |                 "112.90.148.153:443",
 73 |                 "119.188.139.200:443",
 74 |                 "121.30.192.84:443",
 75 |                 "121.30.192.85:443",
 76 |                 "125.39.78.24:443",
 77 |                 "125.39.78.154:443",
 78 |                 "139.209.89.159:443",
 79 |                 "163.177.135.18:443",
 80 |                 "182.118.77.18:443",
 81 |                 "182.118.77.164:443",
 82 |                 "182.118.77.165:443",
 83 |                 "202.110.80.5:443",
 84 |                 "202.110.80.6:443",
 85 |                 "211.90.28.12:443",
 86 |                 "211.90.28.31:443",
 87 |                 "211.90.30.28:443",
 88 |                 "211.90.30.80:443",
 89 |                 "218.58.209.14:443",
 90 |                 "218.58.209.156:443",
 91 |                 "218.60.45.8:443",
 92 |                 "218.60.45.30:443",
 93 |                 "218.60.107.138:443",
 94 |                 "218.60.107.157:443",
 95 |                 "221.204.171.246:443"
 96 |             ]
 97 |         }
 98 |     },
 99 |     {
100 |         "title": "API-HK-Akamai-1",
101 |         "domains": [
102 |             "search.itunes.apple.com"
103 |         ],
104 |         "ips": {
105 |             "HongKong0": [
106 |                 "23.42.189.88:443",
107 |                 "23.50.17.214:443",
108 |                 "23.198.133.66:443",
109 |                 "60.254.170.217:443",
110 |                 "104.114.184.38:443",
111 |                 "184.87.97.50:443"
112 |             ]
113 |         }
114 |     },
115 |     {
116 |         "title": "API-HK-Akamai-2-AMRadio",
117 |         "domains": [
118 |             "radio.itunes.apple.com",
119 |             "radio-activity.itunes.apple.com",
120 |             "radio-services.itunes.apple.com"
121 |         ],
122 |         "ips": {
123 |             "HongKong1": [
124 |                 "23.13.185.169:443",
125 |                 "104.89.141.101:443",
126 |                 "184.87.100.246:443"
127 |             ]
128 |         }
129 |     },
130 |     {
131 |         "title": "Apple Music Streaming and iOS/OS X Apps ",
132 |         "domains": [
133 |             "aod.itunes.apple.com",
134 |             "mvod.itunes.apple.com",
135 |             "streamingaudio.itunes.apple.com"
136 |         ],
137 |         "ips": {
138 |             "ChinaUnicom-ChinaCache": [
139 |                 "27.221.55.13",
140 |                 "36.250.91.30",
141 |                 "61.240.138.248",
142 |                 "101.26.39.9",
143 |                 "101.69.173.75",
144 |                 "112.90.90.125",
145 |                 "119.187.189.9",
146 |                 "119.188.138.14",
147 |                 "121.30.192.12",
148 |                 "123.130.123.8",
149 |                 "123.138.188.129",
150 |                 "123.159.202.140",
151 |                 "124.67.23.16",
152 |                 "139.209.91.73",
153 |                 "153.101.209.36",
154 |                 "163.177.134.10",
155 |                 "163.177.169.29",
156 |                 "182.118.79.14",
157 |                 "183.95.153.12",
158 |                 "211.90.27.8",
159 |                 "218.24.18.6",
160 |                 "218.29.229.222",
161 |                 "218.59.211.41",
162 |                 "218.60.47.145",
163 |                 "218.60.108.138",
164 |                 "221.204.23.22",
165 |                 "221.204.23.24",
166 |                 "221.204.171.158",
167 |                 "222.161.224.12"
168 |             ],
169 |             "ChinaUnicom-ChinaNetCenter": [
170 |                 "36.250.240.96",
171 |                 "36.250.240.97",
172 |                 "36.250.240.100",
173 |                 "36.250.240.102",
174 |                 "36.250.248.64",
175 |                 "36.250.248.65",
176 |                 "42.48.1.71",
177 |                 "42.48.1.72",
178 |                 "42.48.1.73",
179 |                 "42.58.243.160",
180 |                 "58.20.139.52",
181 |                 "58.20.197.65",
182 |                 "58.20.197.66",
183 |                 "60.210.11.73",
184 |                 "60.211.208.205",
185 |                 "60.215.125.74",
186 |                 "60.217.22.137",
187 |                 "60.217.22.139",
188 |                 "60.221.254.222",
189 |                 "60.221.254.223",
190 |                 "60.223.208.72",
191 |                 "60.223.208.73",
192 |                 "61.54.12.16",
193 |                 "61.54.12.46",
194 |                 "61.54.121.32",
195 |                 "61.156.243.46",
196 |                 "61.156.243.252",
197 |                 "61.163.117.37",
198 |                 "110.53.72.56",
199 |                 "110.53.72.57",
200 |                 "110.53.72.59",
201 |                 "110.53.72.60",
202 |                 "110.53.72.61",
203 |                 "110.53.75.45",
204 |                 "110.53.75.46",
205 |                 "110.53.75.47",
206 |                 "113.5.80.40",
207 |                 "113.5.80.42",
208 |                 "113.5.170.36",
209 |                 "113.8.150.48",
210 |                 "113.200.235.32",
211 |                 "113.207.0.70",
212 |                 "113.207.0.71",
213 |                 "113.207.2.72",
214 |                 "113.207.4.67",
215 |                 "113.207.6.58",
216 |                 "113.207.6.59",
217 |                 "113.207.69.75",
218 |                 "113.207.69.136",
219 |                 "113.207.72.68",
220 |                 "115.63.103.171",
221 |                 "119.39.253.33",
222 |                 "121.30.196.118",
223 |                 "122.138.54.73",
224 |                 "123.138.60.182",
225 |                 "124.164.245.161",
226 |                 "124.165.216.253",
227 |                 "124.167.232.95",
228 |                 "124.167.236.85",
229 |                 "124.202.166.54",
230 |                 "124.202.166.56",
231 |                 "125.39.109.45",
232 |                 "125.39.109.46",
233 |                 "125.39.109.49",
234 |                 "125.46.22.130",
235 |                 "125.46.22.131",
236 |                 "125.46.22.132",
237 |                 "125.46.22.133",
238 |                 "125.46.22.134",
239 |                 "125.46.22.135",
240 |                 "175.43.20.79",
241 |                 "175.43.20.80",
242 |                 "175.43.124.197",
243 |                 "175.43.124.205",
244 |                 "175.154.189.31",
245 |                 "175.154.189.32",
246 |                 "175.154.189.48",
247 |                 "218.26.67.76",
248 |                 "218.29.49.41",
249 |                 "218.29.198.20",
250 |                 "218.58.222.94",
251 |                 "218.59.209.47",
252 |                 "218.59.209.77",
253 |                 "218.60.106.93",
254 |                 "218.60.109.142",
255 |                 "218.60.122.60",
256 |                 "218.60.122.62",
257 |                 "218.60.132.154",
258 |                 "218.60.132.155",
259 |                 "218.60.132.156",
260 |                 "218.61.15.69",
261 |                 "219.157.114.82",
262 |                 "220.250.64.18",
263 |                 "221.203.4.67",
264 |                 "221.206.120.67",
265 |                 "221.206.124.45",
266 |                 "222.132.5.87",
267 |                 "222.138.255.51",
268 |                 "222.163.194.82",
269 |                 "222.163.239.224",
270 |                 "222.163.239.245"
271 |             ]
272 |         }
273 |     }
274 | ]
275 | 


--------------------------------------------------------------------------------
/appledns/appledns/install.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | if [ ! -d /koolshare/appledns ]; then
 4 |    mkdir -p /koolshare/appledns
 5 | fi
 6 | 
 7 | rm /koolshare/appledns/*
 8 | cp -rf /tmp/appledns/scripts/appledns.sh /koolshare/scripts/appledns.sh
 9 | cp -rf /tmp/appledns/webs/Module_appledns.asp /koolshare/webs/Module_appledns.asp
10 | cp -rf /tmp/appledns/appledns/* /koolshare/appledns/
11 | cp /tmp/appledns/res/* /koolshare/res/
12 | 
13 | rm -rf /tmp/appledns* >/dev/null 2>&1
14 | 
15 | chmod a+x /koolshare/scripts/appledns.sh
16 | 


--------------------------------------------------------------------------------
/appledns/appledns/res/icon-appledns.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/appledns/appledns/res/icon-appledns.png


--------------------------------------------------------------------------------
/appledns/appledns/scripts/appledns.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | eval `dbus export appledns`
 3 | CONFIG="/koolshare/appledns"
 4 | [ "$appledns_wan" == "1" ] && appledns_config="$CONFIG/tel.json"
 5 | [ "$appledns_wan" == "2" ] && appledns_config="$CONFIG/cmc.json"
 6 | [ "$appledns_wan" == "3" ] && appledns_config="$CONFIG/cnc.json"
 7 | 
 8 | if [ ! -d "/jffs/configs/dnsmasq.d" ];then
 9 | mkdir -p /jffs/configs/dnsmasq.d/
10 | fi
11 | avgcompare(){
12 |   for ip_addr in $*
13 |   do
14 |   avgtime=`ping -s 1000 -c 2 $ip_addr |awk -F'/' '/round-trip/ {print $4}'|sed 's/\.//g'`
15 |   echo "$ip_addr  $avgtime"
16 |   if [ "$avgtime" != "" ];then
17 |   if [ $avgtime -le $compare ];then
18 |   ip_addr_sel=$ip_addr
19 |   compare=$avgtime
20 |   fi
21 |   fi
22 |   done
23 |   echo $ip_addr_sel
24 | }
25 | dnsmasq(){
26 | for domain in $*
27 | do
28 | if [ "$domain" != "itunes.apple.com" ];then
29 | echo "address=/$domain/$ip_addr_sel" >>/jffs/configs/dnsmasq.d/apple.conf
30 | fi
31 | done
32 | }
33 | configuration(){
34 | for i in 3 7 11 15 19
35 | do
36 | eval dm='\
#39;$i''
37 | eval ia='\
#39;$((i+2))''
38 | domains=`awk '{printf $0}' $appledns_config |awk -F'[][]' '{print '$dm'}' |sed 's/\"//g;s/ //g;s/,/ /g'`
39 | ip_addrs=`awk '{printf $0}' $appledns_config |awk -F'[][]' '{print '$ia'}' |sed 's/\"//g;s/ //g;s/,/ /g;s/\:443//g'`
40 | compare=10000000
41 | avgcompare $ip_addrs
42 | dnsmasq $domains
43 | done
44 | sleep 2
45 | cat $CONFIG/appstore |awk '{if( /^a/) {print "address=/"$1".phobos.apple.com""/"$4"" }}' >>/jffs/configs/dnsmasq.d/apple.conf
46 | }
47 | 
48 | if [ "$appledns_enable" == "1" ];then
49 |   rm -rf /jffs/configs/dnsmasq.d/apple.conf >/dev/null 2>&1
50 |   configuration
51 |   service restart_dnsmasq
52 |   echo $(date): --------------appledns start!-------------- >> /tmp/syslog.log
53 |  else
54 |   rm -rf /jffs/configs/dnsmasq.d/apple.conf >/dev/null 2>&1
55 |   service restart_dnsmasq
56 |   echo $(date): --------------appledns stop!-------------- >> /tmp/syslog.log
57 | fi
58 | 


--------------------------------------------------------------------------------
/appledns/appledns/uninstall.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | 
3 | rm -rf /koolshare/appledns/*
4 | rm /koolshare/scripts/appledns.sh
5 | rm /koolshare/webs/Module_appledns.asp
6 | 


--------------------------------------------------------------------------------
/appledns/backup.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | 
 3 | # you can do something here
 4 | # this shell scripts will run at the end of build.py scripts
 5 | 
 6 | tar_name="$1.tar.gz"
 7 | 
 8 | mkdir -p history
 9 | if [ ! -f ./history/version ];then
10 | 	touch ./history/version
11 | fi
12 | 
13 | version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
14 | version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
15 | md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
16 | md5_new=` md5sum $tar_name | awk '{print $1}'`
17 | 
18 | if [ -f ./$tar_name ];then
19 | 	if [ "$version_old" != "$version_new" ];then
20 | 		mkdir ./history/$version_new/
21 | 		cp ./$tar_name ./history/$version_new/
22 | 		echo $version_new $md5_new >> ./history/version
23 | 	fi
24 | fi


--------------------------------------------------------------------------------
/appledns/build.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | MODULE=appledns
 4 | VERSION=0.2
 5 | TITLE=AppleDNS
 6 | DESCRIPTION=加速apple服务
 7 | HOME_URL=Module_appledns.asp
 8 | 
 9 | # Check and include base
10 | DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )"
11 | 
12 | # now include build_base.sh
13 | . $DIR/../softcenter/build_base.sh
14 | 
15 | # change to module directory
16 | cd $DIR
17 | 
18 | # do something here
19 | do_build_result
20 | 
21 | # now backup
22 | sh backup.sh $MODULE
23 | 


--------------------------------------------------------------------------------
/appledns/config.json.js:
--------------------------------------------------------------------------------
1 | {
2 | "version":"0.2",
3 | "md5":"6c7b670ef9451d3c1cb13e1e47b321ba",
4 | "home_url":"Module_appledns.asp",
5 | "title":"AppleDNS",
6 | "description":"加速apple服务",
7 | "build_date":"2017-09-10_23:56:38"
8 | }
9 | 


--------------------------------------------------------------------------------
/appledns/history/0.2/appledns.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/appledns/history/0.2/appledns.tar.gz


--------------------------------------------------------------------------------
/appledns/history/version:
--------------------------------------------------------------------------------
1 | 0.2 e4fd92fd5714c2815915d19bfa94499a
2 | 


--------------------------------------------------------------------------------
/appledns/version:
--------------------------------------------------------------------------------
1 | 0.2
2 | 6c7b670ef9451d3c1cb13e1e47b321ba
3 | 


--------------------------------------------------------------------------------
/ddnspod/Changelog.txt:
--------------------------------------------------------------------------------
 1 | Koolshare Asuswrt-Merlin DDnspod Changelog
 2 | ===========================================
 3 | 
 4 | 0.1.6
 5 | 	- fix 修正版本号替换
 6 | 0.1.5
 7 | 	- fix 修复获取域名IP地址的接口和定时任务配置导致的接口被封禁
 8 | 0.1.4
 9 | 	- fix fix icon height
10 | 0.1.1 ( 01/06/2016 14:49:28 )
11 | 	- init 初始版本
12 | 0.1.2 ( 13/06/2016 14:49:28 )
13 | 	- Change icon
14 | 


--------------------------------------------------------------------------------
/ddnspod/backup.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | 
 3 | # you can do something here
 4 | # this shell scripts will run at the end of build.py scripts
 5 | 
 6 | tar_name="$1.tar.gz"
 7 | 
 8 | mkdir -p history
 9 | if [ ! -f ./history/version ];then
10 | 	touch ./history/version
11 | fi
12 | 
13 | version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
14 | version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
15 | md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
16 | md5_new=` md5sum $tar_name | awk '{print $1}'`
17 | 
18 | if [ -f ./$tar_name ];then
19 | 	if [ "$version_old" != "$version_new" ];then
20 | 		mkdir ./history/$version_new/
21 | 		cp ./$tar_name ./history/$version_new/
22 | 		echo $version_new $md5_new >> ./history/version
23 | 	fi
24 | fi


--------------------------------------------------------------------------------
/ddnspod/build.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | MODULE=ddnspod
 4 | VERSION=0.1.7
 5 | TITLE=DDnspod
 6 | DESCRIPTION=使用Dnspod的ddns服务
 7 | HOME_URL=Module_ddnspod.asp
 8 | 
 9 | # Check and include base
10 | DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )"
11 | 
12 | # now include build_base.sh
13 | . $DIR/../softcenter/build_base.sh
14 | 
15 | # change to module directory
16 | cd $DIR
17 | 
18 | # do something here
19 | do_build_result
20 | 
21 | # now backup
22 | sh backup.sh $MODULE
23 | 


--------------------------------------------------------------------------------
/ddnspod/config.json.js:
--------------------------------------------------------------------------------
1 | {
2 | "version":"0.1.7",
3 | "md5":"41e7334f0e30ddca4b7495931199cfef",
4 | "home_url":"Module_ddnspod.asp",
5 | "title":"DDnspod",
6 | "description":"使用Dnspod的ddns服务",
7 | "build_date":"2020-01-03_14:38:36"
8 | }
9 | 


--------------------------------------------------------------------------------
/ddnspod/ddnspod.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/ddnspod/ddnspod.tar.gz


--------------------------------------------------------------------------------
/ddnspod/ddnspod/ddnspod/ddnspod.sh:
--------------------------------------------------------------------------------
  1 | #!/bin/sh
  2 | 
  3 | #################################################
  4 | # 由AnripDdns修改而来,原版信息如下:
  5 | #################################################
  6 | # AnripDdns v5.08
  7 | # 基于DNSPod用户API实现的动态域名客户端
  8 | # 作者: 若海[mail@anrip.com]
  9 | # 介绍: http://www.anrip.com/ddnspod
 10 | # 时间: 2016-02-24 16:25:00
 11 | # Mod: 荒野无灯 http://ihacklog.com  2016-03-16
 12 | #################################################
 13 | 
 14 | # ====================================变量定义====================================
 15 | # 版本号定义
 16 | version="0.1.6"
 17 | 
 18 | # 导入skipd数据
 19 | eval `dbus export ddnspod`
 20 | 
 21 | # 引用环境变量等
 22 | source /koolshare/scripts/base.sh
 23 | export PERP_BASE=/koolshare/perp
 24 | 
 25 | 
 26 | # 使用Token认证(推荐) 请去 https://www.dnspod.cn/console/user/security 获取
 27 | arToken=$ddnspod_config_token
 28 | # 使用邮箱和密码认证
 29 | arMail=$ddnspod_config_uname
 30 | arPass=$ddnspod_config_pwd
 31 | # 域名
 32 | mainDomain=""
 33 | subDomain=""
 34 | 
 35 | # ====================================函数定义====================================
 36 | # 获得外网地址
 37 | arIpAdress() {
 38 |     #双WAN判断
 39 |     local wans_mode=$(nvram get wans_mode)
 40 |     local inter
 41 |     if [ "$ddnspod_config_wan" == "1" ] && [ "$wans_mode" == "lb" ]; then
 42 |         inter=$(nvram get wan0_ipaddr)
 43 |     elif [ "$ddnspod_config_wan" == "2" ] && [ "$wans_mode" == "lb" ]; then
 44 |         inter=$(nvram get wan1_ipaddr)
 45 |     else
 46 |         inter=$(nvram get wan0_ipaddr)
 47 |     fi
 48 |     echo $inter
 49 | }
 50 | 
 51 | # 查询域名地址
 52 | # 参数: 待查询域名
 53 | arNslookup() {
 54 |     local inter="http://119.29.29.29/d?dn="
 55 |     curl --silent $inter$1
 56 | }
 57 | 
 58 | # 读取接口数据
 59 | # 参数: 接口类型 待提交数据
 60 | arApiPost() {
 61 |     local agent="AnripDdns/5.07(mail@anrip.com)"
 62 |     local inter="https://dnsapi.cn/${1:?'Info.Version'}"
 63 |     if [ "x${arToken}" = "x" ]; then # undefine token
 64 |         local param="login_email=${arMail}&login_password=${arPass}&format=json&${2}"
 65 |     else
 66 |         local param="login_token=${arToken}&format=json&${2}"
 67 |     fi
 68 |     curl -X POST --silent --insecure --user-agent $agent --data $param $inter
 69 | }
 70 | 
 71 | # 更新记录信息
 72 | # 参数: 主域名 子域名
 73 | arDdnsUpdate() {
 74 |     local domainID recordID recordRS recordCD myIP errMsg
 75 |     # 获得域名ID
 76 |     domainID=$(arApiPost "Domain.Info" "domain=${1}")
 77 |     domainID=$(echo $domainID | sed 's/.*"id":"\([0-9]*\)".*/\1/')
 78 |     # 获得记录ID
 79 |     recordID=$(arApiPost "Record.List" "domain_id=${domainID}&sub_domain=${2}")
 80 |     recordID=$(echo $recordID | sed 's/.*\[{"id":"\([0-9]*\)".*/\1/')
 81 |     # 更新记录IP
 82 |     myIP=$($inter)
 83 |     recordRS=$(arApiPost "Record.Ddns" "domain_id=${domainID}&record_id=${recordID}&sub_domain=${2}&value=${myIP}&record_line=默认")
 84 |     recordCD=$(echo $recordRS | sed 's/.*{"code":"\([0-9]*\)".*/\1/')
 85 |     # 输出记录IP
 86 |     if [ "$recordCD" == "1" ]; then
 87 |         echo $recordRS | sed 's/.*,"value":"\([0-9\.]*\)".*/\1/'
 88 |         dbus set ddnspod_run_status="更新成功"
 89 |         return 1
 90 |     fi
 91 |     # 输出错误信息
 92 |     errMsg=$(echo $recordRS | sed 's/.*,"message":"\([^"]*\)".*/\1/')
 93 |     dbus set ddnspod_run_status="$errMsg"
 94 |     echo $errMsg
 95 | }
 96 | 
 97 | # 动态检查更新
 98 | # 参数: 主域名 子域名
 99 | arDdnsCheck() {
100 |     local postRS
101 |     local hostIP=$(arIpAdress)
102 |     local lastIP=$(arNslookup "${2}.${1}")
103 |     echo "hostIP: ${hostIP}"
104 |     echo "lastIP: ${lastIP}"
105 |     if [ "$lastIP" != "$hostIP" ]; then
106 |         dbus set ddnspod_run_status="更新中。。。"
107 |         postRS=$(arDdnsUpdate $1 $2)
108 |         echo "postRS: ${postRS}"
109 |         if [ $? -ne 1 ]; then
110 |             return 1
111 |         fi
112 |     else
113 |         dbus set ddnspod_run_status="wan ip未改变,无需更新"
114 |     fi
115 |     return 0
116 | }
117 | 
118 | parseDomain() {
119 |     mainDomain=${ddnspod_config_domain#*.}
120 |     local tmp=${ddnspod_config_domain%$mainDomain}
121 |     subDomain=${tmp%.}
122 | }
123 | 
124 | #将执行脚本写入crontab定时运行
125 | add_ddnspod_cru(){
126 | 	if [ -f /koolshare/ddnspod/ddnspod.sh ]; then
127 | 		#确保有执行权限
128 | 		chmod +x /koolshare/ddnspod/ddnspod.sh
129 | 		cru a ddnspod "0 */$ddnspod_refresh_time * * * /koolshare/ddnspod/ddnspod.sh restart"
130 | 	fi
131 | }
132 | 
133 | #停止服务
134 | stop_ddnspod(){
135 | 	#停掉cru里的任务
136 |     local ddnspodcru=$(cru l | grep "ddnspod")
137 | 	if [ ! -z "$ddnspodcru" ]; then
138 | 		cru d ddnspod
139 | 	fi
140 | }
141 | 
142 | # 写入版本号
143 | write_ddnspod_version(){
144 | 	dbus set ddnspod_version="$version"
145 | }
146 | 
147 | # ====================================主逻辑====================================
148 | 
149 | case $ACTION in
150 | start)
151 | 	#此处为开机自启动设计
152 | 	if [ "$ddnspod_enable" == "1" ] && [ "$ddnspod_auto_start" == "1" ];then
153 |     parseDomain
154 |     add_ddnspod_cru
155 |     sleep $ddnspod_delay_time
156 |     arDdnsCheck $mainDomain $subDomain
157 | 	fi
158 | 	;;
159 | stop | kill )
160 |     stop_ddnspod
161 | 	;;
162 | restart)
163 |     stop_ddnspod
164 |     parseDomain
165 |     add_ddnspod_cru
166 |     sleep $ddnspod_delay_time
167 |     arDdnsCheck $mainDomain $subDomain
168 | 	write_ddnspod_version
169 | 	;;
170 | *)
171 | 	echo "Usage: $0 (start|stop|restart|kill)"
172 | 	exit 1
173 | 	;;
174 | esac
175 | 
176 | 


--------------------------------------------------------------------------------
/ddnspod/ddnspod/init.d/S99ddnspod.sh:
--------------------------------------------------------------------------------
1 | /koolshare/ddnspod/ddnspod.sh


--------------------------------------------------------------------------------
/ddnspod/ddnspod/install.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | if [ ! -d /koolshare/ddnspod ]; then
 4 |    mkdir -p /koolshare/ddnspod
 5 | fi
 6 | 
 7 | cp -rf /tmp/ddnspod/scripts/* /koolshare/scripts/
 8 | cp -rf /tmp/ddnspod/webs/* /koolshare/webs/
 9 | cp -rf /tmp/ddnspod/res/* /koolshare/res/
10 | cp -rf /tmp/ddnspod/init.d/* /koolshare/init.d/
11 | cp -rf /tmp/ddnspod/ddnspod/ddnspod.sh /koolshare/ddnspod/
12 | rm -rf /tmp/ddnspod* >/dev/null 2>&1
13 | 
14 | chmod a+x /koolshare/scripts/ddnspod_config.sh
15 | chmod a+x /koolshare/ddnspod/ddnspod.sh
16 | chmod a+x /koolshare/init.d/S99ddnspod.sh
17 | 


--------------------------------------------------------------------------------
/ddnspod/ddnspod/res/icon-ddnspod.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/ddnspod/ddnspod/res/icon-ddnspod.png


--------------------------------------------------------------------------------
/ddnspod/ddnspod/res/md5.js:
--------------------------------------------------------------------------------
1 | var md5; md5 || (md5 = function(){function i(a,b){a[b>>5]|=128<<b%32,a[(b+64>>>9<<4)+14]=b;for(var c=1732584193,d=-271733879,e=-1732584194,f=271733878,g=0;a.length>g;g+=16){var h=c,i=d,j=e,o=f;c=k(c,d,e,f,a[g+0],7,-680876936),f=k(f,c,d,e,a[g+1],12,-389564586),e=k(e,f,c,d,a[g+2],17,606105819),d=k(d,e,f,c,a[g+3],22,-1044525330),c=k(c,d,e,f,a[g+4],7,-176418897),f=k(f,c,d,e,a[g+5],12,1200080426),e=k(e,f,c,d,a[g+6],17,-1473231341),d=k(d,e,f,c,a[g+7],22,-45705983),c=k(c,d,e,f,a[g+8],7,1770035416),f=k(f,c,d,e,a[g+9],12,-1958414417),e=k(e,f,c,d,a[g+10],17,-42063),d=k(d,e,f,c,a[g+11],22,-1990404162),c=k(c,d,e,f,a[g+12],7,1804603682),f=k(f,c,d,e,a[g+13],12,-40341101),e=k(e,f,c,d,a[g+14],17,-1502002290),d=k(d,e,f,c,a[g+15],22,1236535329),c=l(c,d,e,f,a[g+1],5,-165796510),f=l(f,c,d,e,a[g+6],9,-1069501632),e=l(e,f,c,d,a[g+11],14,643717713),d=l(d,e,f,c,a[g+0],20,-373897302),c=l(c,d,e,f,a[g+5],5,-701558691),f=l(f,c,d,e,a[g+10],9,38016083),e=l(e,f,c,d,a[g+15],14,-660478335),d=l(d,e,f,c,a[g+4],20,-405537848),c=l(c,d,e,f,a[g+9],5,568446438),f=l(f,c,d,e,a[g+14],9,-1019803690),e=l(e,f,c,d,a[g+3],14,-187363961),d=l(d,e,f,c,a[g+8],20,1163531501),c=l(c,d,e,f,a[g+13],5,-1444681467),f=l(f,c,d,e,a[g+2],9,-51403784),e=l(e,f,c,d,a[g+7],14,1735328473),d=l(d,e,f,c,a[g+12],20,-1926607734),c=m(c,d,e,f,a[g+5],4,-378558),f=m(f,c,d,e,a[g+8],11,-2022574463),e=m(e,f,c,d,a[g+11],16,1839030562),d=m(d,e,f,c,a[g+14],23,-35309556),c=m(c,d,e,f,a[g+1],4,-1530992060),f=m(f,c,d,e,a[g+4],11,1272893353),e=m(e,f,c,d,a[g+7],16,-155497632),d=m(d,e,f,c,a[g+10],23,-1094730640),c=m(c,d,e,f,a[g+13],4,681279174),f=m(f,c,d,e,a[g+0],11,-358537222),e=m(e,f,c,d,a[g+3],16,-722521979),d=m(d,e,f,c,a[g+6],23,76029189),c=m(c,d,e,f,a[g+9],4,-640364487),f=m(f,c,d,e,a[g+12],11,-421815835),e=m(e,f,c,d,a[g+15],16,530742520),d=m(d,e,f,c,a[g+2],23,-995338651),c=n(c,d,e,f,a[g+0],6,-198630844),f=n(f,c,d,e,a[g+7],10,1126891415),e=n(e,f,c,d,a[g+14],15,-1416354905),d=n(d,e,f,c,a[g+5],21,-57434055),c=n(c,d,e,f,a[g+12],6,1700485571),f=n(f,c,d,e,a[g+3],10,-1894986606),e=n(e,f,c,d,a[g+10],15,-1051523),d=n(d,e,f,c,a[g+1],21,-2054922799),c=n(c,d,e,f,a[g+8],6,1873313359),f=n(f,c,d,e,a[g+15],10,-30611744),e=n(e,f,c,d,a[g+6],15,-1560198380),d=n(d,e,f,c,a[g+13],21,1309151649),c=n(c,d,e,f,a[g+4],6,-145523070),f=n(f,c,d,e,a[g+11],10,-1120210379),e=n(e,f,c,d,a[g+2],15,718787259),d=n(d,e,f,c,a[g+9],21,-343485551),c=p(c,h),d=p(d,i),e=p(e,j),f=p(f,o)}return[c,d,e,f]}function j(a,b,c,d,e,f){return p(q(p(p(b,a),p(d,f)),e),c)}function k(a,b,c,d,e,f,g){return j(b&c|~b&d,a,b,e,f,g)}function l(a,b,c,d,e,f,g){return j(b&d|c&~d,a,b,e,f,g)}function m(a,b,c,d,e,f,g){return j(b^c^d,a,b,e,f,g)}function n(a,b,c,d,e,f,g){return j(c^(b|~d),a,b,e,f,g)}function p(a,b){var c=(a&65535)+(b&65535),d=(a>>16)+(b>>16)+(c>>16);return d<<16|c&65535}function q(a,b){return a<<b|a>>>32-b}function r(a){for(var b=[],d=(1<<c)-1,e=0;a.length*c>e;e+=c)b[e>>5]|=(a.charCodeAt(e/c)&d)<<e%32;return b}function t(b){for(var c=a?"0123456789ABCDEF":"0123456789abcdef",d="",e=0;b.length*4>e;e++)d+=c.charAt(b[e>>2]>>e%4*8+4&15)+c.charAt(b[e>>2]>>e%4*8&15);return d}var a=0,c=8;return function(a){return t(i(r(a),a.length*c))}}());


--------------------------------------------------------------------------------
/ddnspod/ddnspod/res/sha1.js:
--------------------------------------------------------------------------------
  1 | /*
  2 |  * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
  3 |  * in FIPS PUB 180-1
  4 |  * Version 2.1a Copyright Paul Johnston 2000 - 2002.
  5 |  * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  6 |  * Distributed under the BSD License
  7 |  * See http://pajhome.org.uk/crypt/md5 for details.
  8 |  */
  9 | 
 10 | /*
 11 |  * Configurable variables. You may need to tweak these to be compatible with
 12 |  * the server-side, but the defaults work in most cases.
 13 |  */
 14 | var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */
 15 | var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */
 16 | var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */
 17 | 
 18 | /*
 19 |  * These are the functions you'll usually want to call
 20 |  * They take string arguments and return either hex or base-64 encoded strings
 21 |  */
 22 | function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
 23 | function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
 24 | function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
 25 | function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
 26 | function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
 27 | function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}
 28 | 
 29 | /*
 30 |  * Perform a simple self-test to see if the VM is working
 31 |  */
 32 | function sha1_vm_test()
 33 | {
 34 |   return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
 35 | }
 36 | 
 37 | /*
 38 |  * Calculate the SHA-1 of an array of big-endian words, and a bit length
 39 |  */
 40 | function core_sha1(x, len)
 41 | {
 42 |   /* append padding */
 43 |   x[len >> 5] |= 0x80 << (24 - len % 32);
 44 |   x[((len + 64 >> 9) << 4) + 15] = len;
 45 | 
 46 |   var w = Array(80);
 47 |   var a =  1732584193;
 48 |   var b = -271733879;
 49 |   var c = -1732584194;
 50 |   var d =  271733878;
 51 |   var e = -1009589776;
 52 | 
 53 |   for(var i = 0; i < x.length; i += 16)
 54 |   {
 55 |     var olda = a;
 56 |     var oldb = b;
 57 |     var oldc = c;
 58 |     var oldd = d;
 59 |     var olde = e;
 60 | 
 61 |     for(var j = 0; j < 80; j++)
 62 |     {
 63 |       if(j < 16) w[j] = x[i + j];
 64 |       else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
 65 |       var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
 66 |                        safe_add(safe_add(e, w[j]), sha1_kt(j)));
 67 |       e = d;
 68 |       d = c;
 69 |       c = rol(b, 30);
 70 |       b = a;
 71 |       a = t;
 72 |     }
 73 | 
 74 |     a = safe_add(a, olda);
 75 |     b = safe_add(b, oldb);
 76 |     c = safe_add(c, oldc);
 77 |     d = safe_add(d, oldd);
 78 |     e = safe_add(e, olde);
 79 |   }
 80 |   return Array(a, b, c, d, e);
 81 | 
 82 | }
 83 | 
 84 | /*
 85 |  * Perform the appropriate triplet combination function for the current
 86 |  * iteration
 87 |  */
 88 | function sha1_ft(t, b, c, d)
 89 | {
 90 |   if(t < 20) return (b & c) | ((~b) & d);
 91 |   if(t < 40) return b ^ c ^ d;
 92 |   if(t < 60) return (b & c) | (b & d) | (c & d);
 93 |   return b ^ c ^ d;
 94 | }
 95 | 
 96 | /*
 97 |  * Determine the appropriate additive constant for the current iteration
 98 |  */
 99 | function sha1_kt(t)
100 | {
101 |   return (t < 20) ?  1518500249 : (t < 40) ?  1859775393 :
102 |          (t < 60) ? -1894007588 : -899497514;
103 | }
104 | 
105 | /*
106 |  * Calculate the HMAC-SHA1 of a key and some data
107 |  */
108 | function core_hmac_sha1(key, data)
109 | {
110 |   var bkey = str2binb(key);
111 |   if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);
112 | 
113 |   var ipad = Array(16), opad = Array(16);
114 |   for(var i = 0; i < 16; i++)
115 |   {
116 |     ipad[i] = bkey[i] ^ 0x36363636;
117 |     opad[i] = bkey[i] ^ 0x5C5C5C5C;
118 |   }
119 | 
120 |   var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
121 |   return core_sha1(opad.concat(hash), 512 + 160);
122 | }
123 | 
124 | /*
125 |  * Add integers, wrapping at 2^32. This uses 16-bit operations internally
126 |  * to work around bugs in some JS interpreters.
127 |  */
128 | function safe_add(x, y)
129 | {
130 |   var lsw = (x & 0xFFFF) + (y & 0xFFFF);
131 |   var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
132 |   return (msw << 16) | (lsw & 0xFFFF);
133 | }
134 | 
135 | /*
136 |  * Bitwise rotate a 32-bit number to the left.
137 |  */
138 | function rol(num, cnt)
139 | {
140 |   return (num << cnt) | (num >>> (32 - cnt));
141 | }
142 | 
143 | /*
144 |  * Convert an 8-bit or 16-bit string to an array of big-endian words
145 |  * In 8-bit function, characters >255 have their hi-byte silently ignored.
146 |  */
147 | function str2binb(str)
148 | {
149 |   var bin = Array();
150 |   var mask = (1 << chrsz) - 1;
151 |   for(var i = 0; i < str.length * chrsz; i += chrsz)
152 |     bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32);
153 |   return bin;
154 | }
155 | 
156 | /*
157 |  * Convert an array of big-endian words to a string
158 |  */
159 | function binb2str(bin)
160 | {
161 |   var str = "";
162 |   var mask = (1 << chrsz) - 1;
163 |   for(var i = 0; i < bin.length * 32; i += chrsz)
164 |     str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);
165 |   return str;
166 | }
167 | 
168 | /*
169 |  * Convert an array of big-endian words to a hex string.
170 |  */
171 | function binb2hex(binarray)
172 | {
173 |   var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
174 |   var str = "";
175 |   for(var i = 0; i < binarray.length * 4; i++)
176 |   {
177 |     str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
178 |            hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8  )) & 0xF);
179 |   }
180 |   return str;
181 | }
182 | 
183 | /*
184 |  * Convert an array of big-endian words to a base-64 string
185 |  */
186 | function binb2b64(binarray)
187 | {
188 |   var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
189 |   var str = "";
190 |   for(var i = 0; i < binarray.length * 4; i += 3)
191 |   {
192 |     var triplet = (((binarray[i   >> 2] >> 8 * (3 -  i   %4)) & 0xFF) << 16)
193 |                 | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
194 |                 |  ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
195 |     for(var j = 0; j < 4; j++)
196 |     {
197 |       if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
198 |       else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
199 |     }
200 |   }
201 |   return str;
202 | }
203 | 


--------------------------------------------------------------------------------
/ddnspod/ddnspod/scripts/ddnspod_config.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | 
 4 | eval `dbus export ddnspod`
 5 | 
 6 | if [ "$ddnspod_enable" == "1" ];then
 7 | 	/koolshare/ddnspod/ddnspod.sh restart
 8 | else
 9 | 	/koolshare/ddnspod/ddnspod.sh stop
10 | fi 
11 | 


--------------------------------------------------------------------------------
/ddnspod/ddnspod/uninstall.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | rm -rf /koolshare/ddnspod
 4 | rm -rf /koolshare/scripts/ddnspod_config.sh
 5 | rm -rf /koolshare/webs/Module_ddnspod.asp
 6 | rm -rf /koolshare/res/icon-ddnspod.png
 7 | rm -rf /koolshare/res/md5.js
 8 | rm -rf /koolshare/res/rsa.js
 9 | rm -rf /koolshare/res/sha1.js
10 | rm -rf /koolshare/scripts/ddnspod_config.sh
11 | rm -rf /koolshare/init.d/S99ddnspod.sh
12 | 


--------------------------------------------------------------------------------
/ddnspod/history/0.1.6/ddnspod.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/ddnspod/history/0.1.6/ddnspod.tar.gz


--------------------------------------------------------------------------------
/ddnspod/history/0.1.7/ddnspod.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/ddnspod/history/0.1.7/ddnspod.tar.gz


--------------------------------------------------------------------------------
/ddnspod/history/version:
--------------------------------------------------------------------------------
1 | 0.1.6 e5fbc2e4497375308c94e76d05ac547a
2 | 0.1.7 41e7334f0e30ddca4b7495931199cfef
3 | 


--------------------------------------------------------------------------------
/ddnspod/version:
--------------------------------------------------------------------------------
1 | 0.1.7
2 | 41e7334f0e30ddca4b7495931199cfef
3 | 


--------------------------------------------------------------------------------
/dualwan/Changelog.txt:
--------------------------------------------------------------------------------
 1 | Koolshare Asuswrt-Merlin dualwan Changelog
 2 | ===========================================
 3 | 0.1 (25/12/2015 01:30:00)
 4 |    - ADD:	add dualwan for Merlin Koolshare firmware Softerware center
 5 | 0.2 (28/04/2016 16:21:00)
 6 |    - 兼容新软件中心
 7 | 0.3 (25/12/2015 01:30:00)
 8 |    - fix ui error
 9 | 0.4 (28/04/2016 16:21:00)
10 |    - fix ui again
11 | 0.5 (28/04/2016 16:21:00)
12 |    - 优化路由表
13 | 0.6 (28/04/2016 16:21:00)
14 |    - 针对移动用户特别优化
15 | 0.7 (28/04/2016 16:21:00)
16 |    - update ip database
17 | 0.8 (28/04/2016 16:21:00)
18 |    - revert to 0.6
19 | 1.0 (24/09/2016 16:21:00)
20 |    - Update the routing table, other operators optimization rules
21 | 1.1 (25/09/2016 16:21:00)
22 |    - fix erro
23 | 


--------------------------------------------------------------------------------
/dualwan/README.md:
--------------------------------------------------------------------------------
1 | 小宝改版固件双线双拨策略路由插件
2 | 


--------------------------------------------------------------------------------
/dualwan/backup.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | 
 3 | # you can do something here
 4 | # this shell scripts will run at the end of build.py scripts
 5 | 
 6 | tar_name="$1.tar.gz"
 7 | 
 8 | mkdir -p history
 9 | if [ ! -f ./history/version ];then
10 | 	touch ./history/version
11 | fi
12 | 
13 | version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
14 | version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
15 | md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
16 | md5_new=` md5sum $tar_name | awk '{print $1}'`
17 | 
18 | if [ -f ./$tar_name ];then
19 | 	if [ "$version_old" != "$version_new" ];then
20 | 		mkdir ./history/$version_new/
21 | 		cp ./$tar_name ./history/$version_new/
22 | 		echo $version_new $md5_new >> ./history/version
23 | 	fi
24 | fi


--------------------------------------------------------------------------------
/dualwan/build.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | MODULE=dualwan
 4 | VERSION=2.2
 5 | TITLE=策略路由
 6 | DESCRIPTION="让分流更简单"
 7 | HOME_URL=Module_policy_route.asp
 8 | 
 9 | # Check and include base
10 | DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )"
11 | 
12 | # now include build_base.sh
13 | . $DIR/../softcenter/build_base.sh
14 | 
15 | # change to module directory
16 | cd $DIR
17 | 
18 | # do something here
19 | do_build_result
20 | 
21 | # now backup
22 | sh backup.sh $MODULE
23 | 


--------------------------------------------------------------------------------
/dualwan/config.json.js:
--------------------------------------------------------------------------------
1 | {
2 | "version":"2.2",
3 | "md5":"351e13b00885782adb0f09eb188d204e",
4 | "home_url":"Module_policy_route.asp",
5 | "title":"策略路由",
6 | "description":"让分流更简单",
7 | "build_date":"2018-12-04_10:17:34"
8 | }
9 | 


--------------------------------------------------------------------------------
/dualwan/dualwan.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/dualwan/dualwan.tar.gz


--------------------------------------------------------------------------------
/dualwan/dualwan/dw/cmc.txt:
--------------------------------------------------------------------------------
 1 | 36.128.0.0/10
 2 | 39.128.0.0/10
 3 | 43.239.172.0/22
 4 | 43.251.244.0/22
 5 | 45.121.68.0/22
 6 | 45.121.72.0/22
 7 | 45.121.172.0/22
 8 | 45.121.176.0/22
 9 | 45.122.96.0/21
10 | 45.123.152.0/22
11 | 45.124.36.0/22
12 | 45.125.24.0/22
13 | 103.20.112.0/22
14 | 103.21.176.0/22
15 | 103.35.104.0/22
16 | 103.61.156.0/22
17 | 103.61.160.0/22
18 | 103.62.24.0/22
19 | 103.62.204.0/22
20 | 103.62.208.0/22
21 | 103.192.0.0/22
22 | 103.192.144.0/22
23 | 103.193.140.0/22
24 | 111.0.0.0/10
25 | 112.0.0.0/10
26 | 117.128.0.0/10
27 | 120.192.0.0/10
28 | 183.192.0.0/10
29 | 211.103.0.0/17
30 | 211.136.0.0/14
31 | 211.140.0.0/15
32 | 211.142.0.0/17
33 | 211.142.128.0/17
34 | 211.143.0.0/16
35 | 218.200.0.0/14
36 | 218.204.0.0/15
37 | 218.206.0.0/15
38 | 221.130.0.0/15
39 | 221.176.0.0/13
40 | 223.64.0.0/11
41 | 223.96.0.0/12
42 | 223.112.0.0/14
43 | 223.116.0.0/15
44 | 223.120.0.0/13
45 | 36.192.0.0/11
46 | 43.247.240.0/22
47 | 61.232.0.0/14
48 | 61.236.0.0/15
49 | 101.144.0.0/12
50 | 103.3.128.0/22
51 | 110.96.0.0/11
52 | 110.192.0.0/11
53 | 115.180.0.0/14
54 | 118.204.0.0/14
55 | 120.90.0.0/15
56 | 122.64.0.0/11
57 | 123.64.0.0/11
58 | 211.98.0.0/16
59 | 221.172.0.0/14
60 | 222.32.0.0/11
61 | 


--------------------------------------------------------------------------------
/dualwan/dualwan/dw/crc.txt:
--------------------------------------------------------------------------------
  1 | 1.51.0.0/16
  2 | 1.184.0.0/15
  3 | 42.244.0.0/14
  4 | 49.52.0.0/14
  5 | 49.120.0.0/14
  6 | 49.140.0.0/15
  7 | 49.208.0.0/15
  8 | 58.154.0.0/15
  9 | 58.192.0.0/15
 10 | 58.194.0.0/15
 11 | 58.196.0.0/15
 12 | 58.198.0.0/15
 13 | 58.200.0.0/13
 14 | 59.64.0.0/14
 15 | 59.68.0.0/14
 16 | 59.72.0.0/15
 17 | 59.74.0.0/15
 18 | 59.76.0.0/16
 19 | 59.77.0.0/16
 20 | 59.78.0.0/15
 21 | 101.4.0.0/14
 22 | 101.76.0.0/15
 23 | 110.64.0.0/15
 24 | 111.114.0.0/15
 25 | 111.116.0.0/15
 26 | 111.186.0.0/15
 27 | 113.54.0.0/15
 28 | 114.212.0.0/15
 29 | 114.214.0.0/16
 30 | 115.24.0.0/14
 31 | 115.154.0.0/15
 32 | 115.156.0.0/15
 33 | 115.158.0.0/16
 34 | 116.13.0.0/16
 35 | 116.56.0.0/15
 36 | 118.202.0.0/15
 37 | 118.228.0.0/15
 38 | 118.230.0.0/16
 39 | 120.94.0.0/16
 40 | 120.95.0.0/16
 41 | 121.48.0.0/15
 42 | 121.52.160.0/19
 43 | 121.192.0.0/16
 44 | 121.193.0.0/16
 45 | 121.194.0.0/15
 46 | 121.248.0.0/14
 47 | 122.204.0.0/14
 48 | 125.216.0.0/15
 49 | 125.218.0.0/16
 50 | 125.219.0.0/16
 51 | 125.220.0.0/15
 52 | 125.222.0.0/15
 53 | 175.185.0.0/16
 54 | 175.186.0.0/15
 55 | 180.84.0.0/15
 56 | 180.201.0.0/16
 57 | 180.208.0.0/15
 58 | 183.168.0.0/15
 59 | 183.170.0.0/16
 60 | 183.172.0.0/14
 61 | 192.124.154.0/24
 62 | 202.4.128.0/19
 63 | 202.38.2.0/23
 64 | 202.38.64.0/19
 65 | 202.38.96.0/19
 66 | 202.38.140.0/23
 67 | 202.38.184.0/21
 68 | 202.38.192.0/18
 69 | 202.112.0.0/16
 70 | 202.113.0.0/20
 71 | 202.113.16.0/20
 72 | 202.113.32.0/19
 73 | 202.113.64.0/18
 74 | 202.113.128.0/18
 75 | 202.113.192.0/19
 76 | 202.113.224.0/20
 77 | 202.113.240.0/20
 78 | 202.114.0.0/19
 79 | 202.114.32.0/19
 80 | 202.114.64.0/18
 81 | 202.114.128.0/17
 82 | 202.115.0.0/19
 83 | 202.115.128.0/17
 84 | 202.116.0.0/19
 85 | 202.116.32.0/20
 86 | 202.116.48.0/20
 87 | 202.116.64.0/19
 88 | 202.116.96.0/19
 89 | 202.116.128.0/17
 90 | 202.117.0.0/18
 91 | 202.117.64.0/18
 92 | 202.117.128.0/17
 93 | 202.118.0.0/19
 94 | 202.118.32.0/19
 95 | 202.118.64.0/18
 96 | 202.118.128.0/17
 97 | 202.119.0.0/19
 98 | 202.119.32.0/19
 99 | 202.119.64.0/20
100 | 202.119.80.0/20
101 | 202.119.96.0/19
102 | 202.119.128.0/17
103 | 202.120.0.0/18
104 | 202.120.64.0/18
105 | 202.120.128.0/17
106 | 202.121.0.0/16
107 | 202.127.216.0/21
108 | 202.127.224.0/19
109 | 202.179.240.0/20
110 | 202.192.0.0/13
111 | 202.200.0.0/14
112 | 202.204.0.0/14
113 | 203.91.120.0/21
114 | 210.25.0.0/16
115 | 210.26.0.0/15
116 | 210.28.0.0/14
117 | 210.32.0.0/14
118 | 210.36.0.0/14
119 | 210.40.0.0/13
120 | 211.64.0.0/14
121 | 211.68.0.0/15
122 | 211.70.0.0/15
123 | 211.80.0.0/16
124 | 211.81.0.0/16
125 | 211.82.0.0/16
126 | 211.83.0.0/16
127 | 211.84.0.0/15
128 | 211.86.0.0/15
129 | 218.192.0.0/16
130 | 218.193.0.0/16
131 | 218.194.0.0/16
132 | 218.195.0.0/16
133 | 218.196.0.0/14
134 | 219.216.0.0/15
135 | 219.218.0.0/15
136 | 219.220.0.0/16
137 | 219.221.0.0/16
138 | 219.222.0.0/15
139 | 219.224.0.0/15
140 | 219.226.0.0/16
141 | 219.227.0.0/16
142 | 219.228.0.0/15
143 | 219.230.0.0/15
144 | 219.242.0.0/15
145 | 219.244.0.0/14
146 | 222.16.0.0/15
147 | 222.18.0.0/15
148 | 222.20.0.0/15
149 | 222.22.0.0/16
150 | 222.23.0.0/16
151 | 222.24.0.0/15
152 | 222.26.0.0/15
153 | 222.28.0.0/14
154 | 222.192.0.0/14
155 | 222.196.0.0/15
156 | 222.198.0.0/16
157 | 222.199.0.0/16
158 | 222.200.0.0/14
159 | 222.204.0.0/15
160 | 222.206.0.0/15
161 | 223.2.0.0/15
162 | 223.128.0.0/15
163 | 


--------------------------------------------------------------------------------
/dualwan/dualwan/install.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | if [ ! -d /koolshare/dw ]; then
 4 |    mkdir -p /koolshare/dw
 5 | fi
 6 | 
 7 | rm /koolshare/dw/*
 8 | cp -rf /tmp/dualwan/scripts/dualwan_policy.sh /koolshare/scripts/dualwan_policy.sh
 9 | cp -rf /tmp/dualwan/webs/Module_policy_route.asp /koolshare/webs/Module_policy_route.asp
10 | cp -rf /tmp/dualwan/dw/* /koolshare/dw/
11 | cp /tmp/dualwan/res/* /koolshare/res
12 | 
13 | rm -rf /tmp/dualwan* >/dev/null 2>&1
14 | 
15 | chmod a+x /koolshare/scripts/dualwan_policy.sh
16 | 


--------------------------------------------------------------------------------
/dualwan/dualwan/res/icon-dualwan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/dualwan/dualwan/res/icon-dualwan.png


--------------------------------------------------------------------------------
/dualwan/dualwan/scripts/dualwan_policy.sh:
--------------------------------------------------------------------------------
  1 | #!/bin/sh
  2 | modprobe xt_set
  3 | # Loading ipset modules
  4 | lsmod | grep "xt_set" > /dev/null 2>&1 || \
  5 | for module in ip_set ip_set_hash_net ip_set_hash_ip xt_set
  6 |     do
  7 |     insmod $module
  8 | done
  9 | # load path environment in dbus databse
 10 | eval `dbus export dualwanpolicy`
 11 | eval `dbus export shadowsocks`
 12 | #source /koolshare/configs/ss.sh
 13 | CONFIG="/koolshare/dw"
 14 | ss_enable=`dbus get ss_basic_enable`
 15 | ss_mode=`dbus get ss_basic_mode`
 16 | [ "$ss_enable" == "0" ] && ss_mode=0
 17 | # run this script when ss start
 18 | start=$(dbus list __event__onssstart_)
 19 | 
 20 | #-------------------------------------------module--------------------------------------------------------
 21 | # detect if the router is arm or mips
 22 | case $(uname -m) in
 23 |   armv7l)
 24 |     MATCH_SET='--match-set'
 25 |     ;;
 26 |   mips)
 27 |     MATCH_SET='--set'
 28 |     ;;
 29 | esac
 30 | 
 31 | ss_start(){
 32 | if [ -z "start" ];then
 33 | dbus event onssstart_policy_route /koolshare/scripts/dualwan_policy.sh
 34 | fi
 35 | }
 36 | stop_policy(){
 37 | # delete possible multip ip rule
 38 | ip_rule_exist=`ip rule show | grep -c "20555"`
 39 | if [ ! -z "ip_rule_exist" ];then
 40 | 	until [ "$ip_rule_exist" = 0 ]
 41 | 	do
 42 |   ip rule del pref 20123 >/dev/null 2>&1
 43 |   ip rule del pref 20124 >/dev/null 2>&1
 44 |   ip rule del from all fwmark 0x22b8 >/dev/null 2>&1
 45 |   ip rule del from all fwmark 0x1e61 >/dev/null 2>&1
 46 | 	ip_rule_exist=`expr $ip_rule_exist - 1`
 47 | 	done
 48 | fi
 49 | 
 50 | for number in $(iptables -t mangle -L OUTPUT -v -n --line-numbers | grep operators | cut -d " " -f 1 | sort -nr)
 51 | 	do
 52 | 		iptables -t mangle -D OUTPUT $number
 53 | done
 54 | for number in $(iptables -t mangle -L PREROUTING -v -n --line-numbers | grep operators | cut -d " " -f 1 | sort -nr)
 55 | 	do
 56 | 		iptables -t mangle -D PREROUTING $number
 57 | done
 58 | 
 59 | ipset -F wan1operators >/dev/null 2>&1
 60 | ipset -F wan2operators >/dev/null 2>&1
 61 | ipset -X wan1operators >/dev/null 2>&1
 62 | ipset -X wan2operators >/dev/null 2>&1
 63 | 
 64 | for tun_number in $(ip route list table 100 | grep "tun" | awk '{print $3}')
 65 | 	do
 66 |         ip_route=$(ip route list table 100 | grep $tun_number)
 67 |         ip route del $ip_route table 100 >/dev/null 2>&1
 68 | done
 69 | for tun_number in $(ip route list table 200 | grep "tun" | awk '{print $3}')
 70 |         do
 71 |         ip_route=$(ip route list table 200 | grep $tun_number)
 72 |         ip route del $ip_route table 200 >/dev/null 2>&1
 73 | done
 74 | }
 75 | 
 76 | auto_start(){
 77 |    # creating iptables rules to firewall-start
 78 |    if [ ! -d /jffs/scripts ]; then
 79 |       mkdir -p /jffs/scripts
 80 |    fi
 81 | 
 82 |    if [ ! -f /jffs/scripts/firewall-start ]; then
 83 |       cat > /jffs/scripts/firewall-start <<EOF
 84 | #!/bin/sh
 85 | EOF
 86 |    fi
 87 | 
 88 |    writenat=$(cat /jffs/scripts/firewall-start | grep "dualwan_policy")
 89 |    if [ -z "$writenat" ];then
 90 | 	   sed -i '1a sleep 10' /jffs/scripts/firewall-start
 91 | 	   sed -i '2a /koolshare/scripts/dualwan_policy.sh' /jffs/scripts/firewall-start
 92 | 	   chmod +x /jffs/scripts/firewall-start
 93 |    fi
 94 | 
 95 |    # creating iptables rules to openvpn-event
 96 |    if [ ! -d /jffs/scripts ]; then
 97 |       mkdir -p /jffs/scripts
 98 |    fi
 99 | 
100 |    if [ ! -f /jffs/scripts/openvpn-event ]; then
101 |       cat > /jffs/scripts/openvpn-event <<EOF
102 | #!/bin/sh
103 | EOF
104 |    fi
105 | 
106 |    writenat=$(cat /jffs/scripts/openvpn-event | grep "ip_route")
107 |    if [ -z "$writenat" ];then
108 | 	   sed -i '1a sleep 10' /jffs/scripts/openvpn-event
109 | 	   sed -i '2a for tun_number in $(ip route | grep "tun" | awk '"'"'{print $3}'"'"')' /jffs/scripts/openvpn-event
110 | 	   sed -i '3a do' /jffs/scripts/openvpn-event
111 | 	   sed -i '4a ip_route=$(ip route | grep $tun_number)' /jffs/scripts/openvpn-event
112 | 	   sed -i '5a ip route add $ip_route table 100 >/dev/null 2>&1' /jffs/scripts/openvpn-event
113 | 	   sed -i '6a ip route add $ip_route table 200 >/dev/null 2>&1' /jffs/scripts/openvpn-event
114 | 	   sed -i '7a done' /jffs/scripts/openvpn-event
115 | 	   chmod +x /jffs/scripts/openvpn-event
116 |    fi
117 | }
118 | 
119 | auto_stop(){
120 |    # clear start up command line in firewall-start
121 |    sed -i '/sleep 10/d' /jffs/scripts/firewall-start >/dev/null 2>&1
122 |    sed -i '/dualwan_policy/d' /jffs/scripts/firewall-start >/dev/null 2>&1
123 |    # clear start up command line in openvpn-event
124 |    sed -i '/do/d' /jffs/scripts/openvpn-event >/dev/null 2>&1
125 |    sed -i '/sleep 10/d' /jffs/scripts/openvpn-event >/dev/null 2>&1
126 |    sed -i '/tun_number/d' /jffs/scripts/openvpn-event >/dev/null 2>&1
127 |    sed -i '/ip_route/d' /jffs/scripts/openvpn-event >/dev/null 2>&1
128 |    echo $(date): ------------------ Custom operators rule runs stop!------------------  >> /tmp/syslog.log
129 | }
130 | 
131 | start_policy(){
132 | [ "$dualwanpolicy_wan_foreign" == "1" ] && operators_foreign="7777"
133 | [ "$dualwanpolicy_wan_foreign" == "2" ] && operators_foreign="8888"
134 | [ "$dualwanpolicy_wan_ss" == "1" ] && sstable="100"
135 | [ "$dualwanpolicy_wan_ss" == "2" ] && sstable="200"
136 | [ "$dualwanpolicy_wan1" == "1" ] && operators1_config="$CONFIG/cnn.txt"
137 | [ "$dualwanpolicy_wan1" == "2" ] && operators1_config=$dualwanpolicy_wan1_custom
138 | [ "$dualwanpolicy_wan2" == "1" ] && operators2_config="$CONFIG/tel.txt"
139 | [ "$dualwanpolicy_wan2" == "2" ] && operators2_config="$CONFIG/cmc.txt"
140 | [ "$dualwanpolicy_wan2" == "3" ] && operators2_config="$CONFIG/cnc.txt"
141 | [ "$dualwanpolicy_wan2" == "4" ] && operators2_config="$CONFIG/crc.txt"
142 | [ "$dualwanpolicy_wan2" == "5" ] && operators2_config=$dualwanpolicy_wan2_custom
143 | if [ "$dualwanpolicy_wan2" == "1" ];then
144 | 	use_wan2operators=$operators2_config
145 | 	sed -e "s/^/-A wan2operators &/g" -e "1 i\-N wan2operators nethash --hashsize 91260" $use_wan2operators | awk '{print $0} END{print "COMMIT"}' | ipset -R
146 | 	iptables -t mangle -A PREROUTING -m set $MATCH_SET wan2operators dst  -j MARK --set-mark 8888 >/dev/null 2>&1
147 | 	iptables -t mangle -A PREROUTING -m set ! $MATCH_SET wan2operators dst -j MARK --set-mark 7777 >/dev/null 2>&1
148 | 	iptables -t mangle -A OUTPUT -m set $MATCH_SET wan2operators dst  -j MARK --set-mark 8888 >/dev/null 2>&1
149 | 	iptables -t mangle -A OUTPUT -m set ! $MATCH_SET wan2operators dst -j MARK --set-mark 7777 >/dev/null 2>&1
150 | else
151 | 	use_wan1operators=$operators1_config
152 | 	sed -e "s/^/-A wan1operators &/g" -e "1 i\-N wan1operators nethash --hashsize 91260" $use_wan1operators | awk '{print $0} END{print "COMMIT"}' | ipset -R
153 | 	use_wan2operators=$operators2_config
154 | 	sed -e "s/^/-A wan2operators &/g" -e "1 i\-N wan2operators nethash --hashsize 16384" $use_wan2operators | awk '{print $0} END{print "COMMIT"}' | ipset -R
155 | 	iptables -t mangle -A PREROUTING -m set ! $MATCH_SET wan1operators dst -j MARK --set-mark $operators_foreign >/dev/null 2>&1
156 | 	iptables -t mangle -A PREROUTING -m set $MATCH_SET wan1operators dst  -j MARK --set-mark 7777 >/dev/null 2>&1
157 | 	iptables -t mangle -A PREROUTING -m set $MATCH_SET wan2operators dst  -j MARK --set-mark 8888 >/dev/null 2>&1
158 | 	iptables -t mangle -A OUTPUT -m set ! $MATCH_SET wan1operators dst -j MARK --set-mark $operators_foreign >/dev/null 2>&1
159 | 	iptables -t mangle -A OUTPUT -m set $MATCH_SET wan1operators dst  -j MARK --set-mark 7777 >/dev/null 2>&1
160 | 	iptables -t mangle -A OUTPUT -m set $MATCH_SET wan2operators dst  -j MARK --set-mark 8888 >/dev/null 2>&1
161 | fi
162 | if [ ! -z "$shadowsocks_server_ip" ] && [ "$ss_mode" != "0" ];then
163 | 	ip rule add from $shadowsocks_server_ip table $sstable pref 20123
164 | 	ip rule add to $shadowsocks_server_ip table $sstable pref 20124
165 | fi
166 | ip rule add fwmark 7777 table 100 pref 20555
167 | ip rule add fwmark 8888 table 200 pref 20666
168 | 
169 | for tun_number in $(ip route | grep "tun" | awk '{print $3}')
170 | 	do
171 | 		ip_route=$(ip route | grep $tun_number)
172 | 		ip route add $ip_route table 100 >/dev/null 2>&1
173 | 		ip route add $ip_route table 200 >/dev/null 2>&1
174 | done
175 | 
176 | echo 4 > /proc/sys/net/ipv4/rt_cache_rebuild_count
177 | 
178 | #Flush IP Route Cache
179 | ip route flush cache
180 | echo $(date): --------------Custom operators rule runs successfully!-------------- >> /tmp/syslog.log
181 | }
182 | 
183 | 
184 | 
185 | #---------------------------------------------start or stop--------------------------------------------------
186 | 
187 | if [ "$dualwanpolicy_enable" == "1" ];then
188 |    stop_policy
189 |    start_policy
190 |    auto_start
191 |    ss_start
192 |  else
193 |   stop_policy
194 |   auto_stop
195 | fi
196 | 


--------------------------------------------------------------------------------
/dualwan/dualwan/uninstall.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | 
3 | rm -rf /koolshare/dw/*
4 | rm /koolshare/scripts/dualwan_policy.sh
5 | rm /koolshare/webs/Module_policy_route.asp
6 | 


--------------------------------------------------------------------------------
/dualwan/history/2.0/dualwan.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/dualwan/history/2.0/dualwan.tar.gz


--------------------------------------------------------------------------------
/dualwan/history/2.1/dualwan.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/dualwan/history/2.1/dualwan.tar.gz


--------------------------------------------------------------------------------
/dualwan/history/2.2/dualwan.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/dualwan/history/2.2/dualwan.tar.gz


--------------------------------------------------------------------------------
/dualwan/history/version:
--------------------------------------------------------------------------------
1 | 2.0 a9dacced901f2e4ce1d7004334c83c01
2 | 2.1 81539b2317b8f859724a84b400d2117a
3 | 2.2 351e13b00885782adb0f09eb188d204e
4 | 


--------------------------------------------------------------------------------
/dualwan/version:
--------------------------------------------------------------------------------
1 | 2.2
2 | 351e13b00885782adb0f09eb188d204e
3 | 


--------------------------------------------------------------------------------
/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/favicon.ico


--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
 1 | <html>
 2 | <head>
 3 |     <meta name="KoolshareMonitor" content="KoolshareMonitor Tag">
 4 |     <title>Hello to everyone</title>
 5 | </head>
 6 | <body>
 7 |     <h1>Hello to everyone </h1>
 8 | </body>
 9 | </html>
10 | 


--------------------------------------------------------------------------------
/koolnet/backup.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | 
 3 | # you can do something here
 4 | # this shell scripts will run at the end of build.py scripts
 5 | 
 6 | tar_name="$1.tar.gz"
 7 | 
 8 | mkdir -p history
 9 | if [ ! -f ./history/version ];then
10 | 	touch ./history/version
11 | fi
12 | 
13 | version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
14 | version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
15 | md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
16 | md5_new=` md5sum $tar_name | awk '{print $1}'`
17 | 
18 | if [ -f ./$tar_name ];then
19 | 	if [ "$version_old" != "$version_new" ];then
20 | 		mkdir ./history/$version_new/
21 | 		cp ./$tar_name ./history/$version_new/
22 | 		echo $version_new $md5_new >> ./history/version
23 | 	fi
24 | fi


--------------------------------------------------------------------------------
/koolnet/build.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | MODULE=koolnet
 4 | VERSION=0.2
 5 | TITLE="P2P 穿透"
 6 | DESCRIPTION="点对点建立连接,下载更快"
 7 | 
 8 | # Check and include base
 9 | DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )"
10 | 
11 | # now include build_base.sh
12 | . $DIR/../softcenter/build_base.sh
13 | 
14 | # change to module directory
15 | cd $DIR
16 | 
17 | # do something here
18 | do_build_result
19 | 
20 | # now backup
21 | sh backup.sh $MODULE


--------------------------------------------------------------------------------
/koolnet/config.json.js:
--------------------------------------------------------------------------------
1 | {
2 | "version":"0.2",
3 | "md5":"897190feb1e6605a990fb5190110217e",
4 | "home_url":"",
5 | "title":"P2P 穿透",
6 | "description":"点对点建立连接,下载更快",
7 | "build_date":"2017-09-10_23:58:09"
8 | }
9 | 


--------------------------------------------------------------------------------
/koolnet/history/0.2/koolnet.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/koolnet/history/0.2/koolnet.tar.gz


--------------------------------------------------------------------------------
/koolnet/history/version:
--------------------------------------------------------------------------------
1 | 0.2 897190feb1e6605a990fb5190110217e
2 | 


--------------------------------------------------------------------------------
/koolnet/koolnet.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/koolnet/koolnet.tar.gz


--------------------------------------------------------------------------------
/koolnet/koolnet/bin/koolnet:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/koolnet/koolnet/bin/koolnet


--------------------------------------------------------------------------------
/koolnet/koolnet/init.d/S90koolnet.sh:
--------------------------------------------------------------------------------
1 | /koolshare/scripts/config-koolnet.sh


--------------------------------------------------------------------------------
/koolnet/koolnet/install.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | MODULE=koolnet
 4 | 
 5 | cd /
 6 | cp -f /tmp/$MODULE/bin/* /koolshare/bin/
 7 | cp -f /tmp/$MODULE/scripts/* /koolshare/scripts/
 8 | cp -f /tmp/$MODULE/webs/* /koolshare/webs/
 9 | cp -f /tmp/$MODULE/res/* /koolshare/res/
10 | cp -f /tmp/$MODULE/init.d/* /koolshare/init.d/
11 | rm -f /tmp/koolnet* >/dev/null 2>&1
12 | 
13 | 
14 | 
15 | chmod 755 /koolshare/bin/koolnet
16 | chmod 755 /koolshare/scripts/*
17 | 


--------------------------------------------------------------------------------
/koolnet/koolnet/res/icon-koolnet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/koolnet/koolnet/res/icon-koolnet.png


--------------------------------------------------------------------------------
/koolnet/koolnet/scripts/config-koolnet.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | source /koolshare/scripts/base.sh
 4 | eval `dbus export koolnet`
 5 | 
 6 | PROCS=/koolshare/bin/koolnet
 7 | SERVICE_DAEMONIZE=1
 8 | SERVICE_WRITE_PID=1
 9 | SERVICE_PID_FILE=/tmp/var/koolnet.pid
10 | ARGS="/tmp/koolnet.json"
11 | 
12 | koolnet_start() {
13 | 
14 | if [ "$koolnet_enable" == "1" ] ; then
15 | if [ ! -f $PROCS ]; then
16 | 	start_download
17 | fi
18 | 
19 | if [ ! -z $koolnet_txt ] ; then
20 | echo $koolnet_txt|base64_decode > /tmp/koolnet.json
21 | kservice_start $PROCS $ARGS
22 | fi
23 | 
24 | fi
25 | 
26 | }
27 | 
28 | 
29 | case $ACTION in
30 | start)
31 |     koolnet_start
32 |     ;;
33 | stop | kill )
34 |     kservice_stop $PROCS
35 |     ;;
36 | restart)
37 |     kservice_stop $PROCS
38 |     koolnet_start
39 |     ;;
40 | *)
41 |     kservice_stop $PROCS
42 |     koolnet_start
43 |     ;;
44 | esac
45 | 


--------------------------------------------------------------------------------
/koolnet/koolnet/uninstall.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | 
3 | MODULE=koolnet
4 | 
5 | rm -f /koolshare/bin/$MODULE
6 | rm -f /koolshare/scripts/config-$MODULE.sh
7 | rm -f /koolshare/webs/Module_$MODULE.asp
8 | rm -f /koolshare/init.d/S90$MODULE.sh
9 | 


--------------------------------------------------------------------------------
/koolnet/version:
--------------------------------------------------------------------------------
1 | 0.2
2 | 897190feb1e6605a990fb5190110217e
3 | 


--------------------------------------------------------------------------------
/koolnet/windows.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/koolnet/windows.zip


--------------------------------------------------------------------------------
/kuainiao/Changelog.txt:
--------------------------------------------------------------------------------
 1 | Koolshare Asuswrt-Merlin KuaiNiao Changelog
 2 | ===========================================
 3 | 0.3.4 ( 20/06/2016 14:41:00 )
 4 | 	-fix	修复迅雷快鸟心跳保持失败
 5 | 
 6 | 0.3.3 ( 17/05/2016 13:34:00 )
 7 | 	-fix	修复运行脚本bug
 8 | 
 9 | 0.3.2 ( 17/05/2016 13:28:00 )
10 | 	-fix	修复运行脚本bug
11 | 
12 | 0.3.0 ( 17/05/2016 12:33:26 )
13 | 	-fix	更换协议版本为1.0.8
14 | 
15 | 0.2.5
16 | 	-fix	修复加速状态提示
17 | 
18 | 0.2.4
19 | 	-fix	remove old install module and set version check in web
20 | 
21 | 0.2.3
22 | 	-fix	fix installation issue
23 | 
24 | 0.2.2
25 | 	-fix	adapt to new softerware center
26 | 
27 | 0.2.1 ( 11/04/2016 17:07:36 )
28 | 	- fix	双WAN模式下获取网关地址的错误
29 | 	- change	修复默认的MAC地址获取逻辑,防止迅雷检查异常
30 | 
31 | 0.2.0 ( 01/04/2016 15:19:20 )
32 | 	- add	支持双WAN模式下的快鸟绑定指定端口加速
33 | 
34 | 0.1.2 ( 31/03/2016 10:41:28 )
35 | 	- fix	因为迅雷移动端登陆接口增加UA认证导致的插件无法使用的异常
36 | 


--------------------------------------------------------------------------------
/kuainiao/backup.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | 
 3 | # you can do something here
 4 | # this shell scripts will run at the end of build.py scripts
 5 | 
 6 | tar_name="$1.tar.gz"
 7 | 
 8 | mkdir -p history
 9 | if [ ! -f ./history/version ];then
10 | 	touch ./history/version
11 | fi
12 | 
13 | version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
14 | version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
15 | md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
16 | md5_new=` md5sum $tar_name | awk '{print $1}'`
17 | 
18 | if [ -f ./$tar_name ];then
19 | 	if [ "$version_old" != "$version_new" ];then
20 | 		mkdir ./history/$version_new/
21 | 		cp ./$tar_name ./history/$version_new/
22 | 		echo $version_new $md5_new >> ./history/version
23 | 	fi
24 | fi


--------------------------------------------------------------------------------
/kuainiao/build.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | MODULE=kuainiao
 4 | VERSION=0.3.6
 5 | TITLE=讯雷快鸟
 6 | DESCRIPTION="迅雷快鸟,为上网加速而生~"
 7 | HOME_URL=Module_kuainiao.asp
 8 | 
 9 | # Check and include base
10 | DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )"
11 | 
12 | # now include build_base.sh
13 | . $DIR/../softcenter/build_base.sh
14 | 
15 | # change to module directory
16 | cd $DIR
17 | 
18 | # do something here
19 | do_build_result
20 | 
21 | # now backup
22 | sh backup.sh $MODULE


--------------------------------------------------------------------------------
/kuainiao/config.json.js:
--------------------------------------------------------------------------------
1 | {
2 | "version":"0.3.6",
3 | "md5":"4f2b0d456361b5adf23f566c0e4e637d",
4 | "home_url":"Module_kuainiao.asp",
5 | "title":"讯雷快鸟",
6 | "description":"迅雷快鸟,为上网加速而生~",
7 | "build_date":"2017-09-10_23:58:54"
8 | }
9 | 


--------------------------------------------------------------------------------
/kuainiao/history/0.3.6/kuainiao.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/kuainiao/history/0.3.6/kuainiao.tar.gz


--------------------------------------------------------------------------------
/kuainiao/history/version:
--------------------------------------------------------------------------------
1 | 0.3.6 4f2b0d456361b5adf23f566c0e4e637d
2 | 


--------------------------------------------------------------------------------
/kuainiao/kuainiao.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/kuainiao/kuainiao.tar.gz


--------------------------------------------------------------------------------
/kuainiao/kuainiao/install.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | if [ ! -d /koolshare/kuainiao ]; then
 4 |    mkdir -p /koolshare/kuainiao
 5 | fi
 6 | 
 7 | cp -rf /tmp/kuainiao/scripts/* /koolshare/scripts/
 8 | cp -rf /tmp/kuainiao/webs/* /koolshare/webs/
 9 | cp -rf /tmp/kuainiao/res/* /koolshare/res/
10 | cp -rf /tmp/kuainiao/kuainiao/kuainiao.sh /koolshare/kuainiao/
11 | rm -rf /tmp/kuainiao* >/dev/null 2>&1
12 | 
13 | chmod a+x /koolshare/scripts/kuainiao_config.sh
14 | chmod a+x /koolshare/kuainiao/kuainiao.sh
15 | 


--------------------------------------------------------------------------------
/kuainiao/kuainiao/kuainiao/kuainiao.sh:
--------------------------------------------------------------------------------
  1 | #!/bin/sh
  2 | eval `dbus export kuainiao`
  3 | source /koolshare/scripts/base.sh
  4 | version="0.3.6"
  5 | 
  6 | #双WAN判断
  7 | wans_mode=$(nvram get wans_mode)
  8 | if [ "$kuainiao_config_wan" == "1" ] && [ "$wans_mode" == "lb" ]; then
  9 | 	wan_selected=$(nvram get wan0_ipaddr)
 10 | 	if [ "$wan_selected" != "0.0.0.0" ]; then
 11 | 		bind_address=$wan_selected
 12 | 	else
 13 | 		bind_address=""
 14 | 	fi
 15 | elif [ "$kuainiao_config_wan" == "2" ] && [ "$wans_mode" == "lb" ]; then
 16 | 	wan_selected=$(nvram get wan1_ipaddr)
 17 | 	if [ "$wan_selected" != "0.0.0.0" ]; then
 18 | 		bind_address=$wan_selected
 19 | 	else
 20 | 		bind_address=""
 21 | 	fi
 22 | else
 23 | 	bind_address=""
 24 | fi
 25 | 
 26 | #定义请求函数
 27 | if [ -n "$bind_address" ]; then
 28 | 	HTTP_REQ="wget --bind-address=$bind_address --no-check-certificate -O - "
 29 | 	POST_ARG="--post-data="
 30 | else
 31 | 	HTTP_REQ="wget --no-check-certificate -O - "
 32 | 	POST_ARG="--post-data="
 33 | fi
 34 | 
 35 | #获取加速API
 36 | get_kuainiao_api(){
 37 | 	portal=`$HTTP_REQ http://api.portal.swjsq.vip.xunlei.com:81/v2/queryportal`
 38 | 	portal_ip=`echo $portal|grep -oE '([0-9]{1,3}[\.]){3}[0-9]{1,3}'`
 39 | 	portal_port_temp=`echo $portal|grep -oE "port...[0-9]{1,5}"`
 40 | 	portal_port=`echo $portal_port_temp|grep -oE '[0-9]{1,5}'`
 41 | 	if [ -z "$portal_ip" ]
 42 | 		then
 43 | 			dbus set kuainiao_warning="迅雷快鸟服务API获取失败,请检查网络环境,或稍后再试!"
 44 | 			#echo "迅雷快鸟服务API获取失败,请检查网络环境,或稍后再试!"
 45 | 		else
 46 | 			api_url="http://$portal_ip:$portal_port/v2"
 47 | 			dbus set kuainiao_config_api=$api_url
 48 | 	fi
 49 | }
 50 | 
 51 | #从dbus中获取uid,pwd等
 52 | uid=$kuainiao_config_uid
 53 | pwd=$kuainiao_config_pwd
 54 | nic=$kuainiao_config_nic
 55 | peerid=$kuainiao_config_peerid
 56 | uid_orig=$uid
 57 | api_url=$kuainiao_config_api
 58 | devicesign=$kuainiao_device_sign
 59 | dial_account=$kuainiao_dial_account
 60 | app_version=$kuainiao_app_version
 61 | 
 62 | #初始化计数器
 63 | if [ -z "$kuainiao_run_i" ]; then
 64 | 	dbus ram kuainiao_run_i=6
 65 | 	kuainiao_run_i=6
 66 | fi
 67 | 
 68 | #初始化运行状态(kuainiao_run_status 0表示运行异常,1表示运行正常)
 69 | if [ -z "$kuainiao_run_status" ]; then
 70 | 	dbus ram kuainiao_run_status=0
 71 | 	kuainiao_run_status=0
 72 | fi
 73 | 
 74 | #判断是否可以加速
 75 | if [[ ! $kuainiao_can_upgrade -eq 1 ]]; then
 76 | 	dbus ram kuainiao_run_i=6
 77 | 	dbus ram kuainiao_run_warnning="您的宽带不能使用讯鸟快鸟加速!"$(date "+%Y-%m-%d %H:%M:%S")
 78 | 	dbus ram kuainiao_run_status=0
 79 | 	exit 21
 80 | fi
 81 | 
 82 | #初始化日期
 83 | if [[ -z $kuainiao_run_orig_day ]]; then
 84 | 	day_of_month_orig=`date +%d`
 85 | 	orig_day_of_month=`echo $day_of_month_orig|grep -oE "[1-9]{1,2}"`
 86 | 	dbus ram kuainiao_run_orig_day=$orig_day_of_month
 87 | 	kuainiao_run_orig_day=$orig_day_of_month
 88 | fi
 89 | 
 90 | #开始执行逻辑
 91 | ##判断是否跨天
 92 | day_of_month_orig=`date +%d`
 93 | day_of_month=`echo $day_of_month_orig|grep -oE "[1-9]{1,2}"`
 94 | if [[ -z $kuainiao_run_orig_day || $day_of_month -ne $kuainiao_run_orig_day ]]; then
 95 | 	dbus ram kuainiao_run_orig_day=$day_of_month
 96 | 	kuainiao_run_orig_day=$day_of_month
 97 | 	_ts=`date +%s`000
 98 | 	$HTTP_REQ "$api_url/recover?peerid=$peerid&userid=$uid&user_type=1&sessionid=$kuainiao_run_session&dial_account=$dial_account&client_type=android-swjsq-$app_version&client_version=androidswjsq-$app_version&os=android-5.0.1.24SmallRice&time_and=$_ts"
 99 | 	dbus ram kuainiao_run_i=6
100 | 	kuainiao_run_i=6
101 | 	sleep 5
102 | fi
103 | 
104 | #判断是否需要重新登陆
105 | if test $kuainiao_run_i -ge 6; then
106 | 	#改变sequenceNo值
107 | 	sequence=$(expr $kuainiao_run_i + 100001)
108 | 	ret=`$HTTP_REQ --header "User-Agent: android-async-http/xl-acc-sdk/version-1.6.1.177600" https://login.mobile.reg2t.sandai.net:443/ $POST_ARG"{\"userName\": \""$kuainiao_config_uname"\", \"businessType\": 68, \"clientVersion\": \"2.0.3.4\", \"appName\": \"ANDROID-com.xunlei.vip.swjsq\", \"isCompressed\": 0, \"sequenceNo\": "$sequence", \"sessionID\": \"\", \"loginType\": 0, \"rsaKey\": {\"e\": \"010001\", \"n\": \"AC69F5CCC8BDE47CD3D371603748378C9CFAD2938A6B021E0E191013975AD683F5CBF9ADE8BD7D46B4D2EC2D78AF146F1DD2D50DC51446BB8880B8CE88D476694DFC60594393BEEFAA16F5DBCEBE22F89D640F5336E42F587DC4AFEDEFEAC36CF007009CCCE5C1ACB4FF06FBA69802A8085C2C54BADD0597FC83E6870F1E36FD\"}, \"cmdID\": 1, \"verifyCode\": \"\", \"peerID\": \""$peerid"\", \"protocolVersion\": 108, \"platformVersion\": 1, \"passWord\": \""$pwd"\", \"extensionList\": \"\", \"verifyKey\": \"\", \"sdkVersion\": 177550, \"devicesign\": \""$devicesign"\"}"`
109 | 	session=`echo $ret|awk -F '"sessionID":' '{print $2}'|awk -F ',' '{print $1}'|grep -oE "[A-F,0-9]{32}"`
110 | 	uid=`echo $ret|awk -F '"userID":' '{print $2}' | awk -F ',' '{print $1}'`
111 | 	#判断登陆是否成功
112 | 	if [ -z "$session" ]; then
113 | 		#登陆失败重置计数器到6
114 | 		dbus ram kuainiao_run_i=6
115 | 		dbus ram kuainiao_run_warnning="迅雷账号登陆失败!请检查迅雷账号配置!"$(date "+%Y-%m-%d %H:%M:%S")
116 | 		dbus ram kuainiao_run_status=0
117 | 		exit 20
118 | 	else
119 | 		#登陆成功设置登陆日期和session
120 | 		day_of_month_orig=`date +%d`
121 | 		orig_day_of_month=`echo $day_of_month_orig|grep -oE "[1-9]{1,2}"`
122 | 		dbus ram kuainiao_run_orig_day=$orig_day_of_month
123 | 		dbus ram kuainiao_run_session=$session
124 | 		kuainiao_run_orig_day=$orig_day_of_month
125 | 		kuainiao_run_session=$session
126 | 	fi
127 | 	#判断返回的uid
128 | 	if [ -z "$uid" ]; then
129 | 		uid=$uid_orig
130 | 	fi
131 | 	#登陆完成重置计数器
132 | 	dbus ram kuainiao_run_i=0
133 | 	kuainiao_run_i=0
134 | 	#登录完成重置下加速api
135 | 	get_kuainiao_api
136 | 	#开始加速
137 | 	_ts=`date +%s`000
138 | 	$HTTP_REQ "$api_url/upgrade?peerid=$peerid&userid=$uid&user_type=1&sessionid=$kuainiao_run_session&dial_account=$dial_account&client_type=android-swjsq-$app_version&client_version=androidswjsq-$app_version&os=android-5.0.1.24SmallRice&time_and=$_ts"
139 | fi
140 | 
141 | sleep 1
142 | 
143 | #保持心跳
144 | _ts=`date +%s`000
145 | ret=`$HTTP_REQ "$api_url/keepalive?peerid=$peerid&userid=$uid&user_type=1&sessionid=$kuainiao_run_session&dial_account=$dial_account&client_type=android-swjsq-$app_version&client_version=androidswjsq-$app_version&os=android-5.0.1.24SmallRice&time_and=$_ts"`
146 | if [ ! -z "`echo $ret|grep "not exist channel"`" ]; then
147 | 	dbus ram kuainiao_run_i=6
148 | 	dbus ram kuainiao_run_warnning="迅雷快鸟心跳保持失败!"$(date "+%Y-%m-%d %H:%M:%S")
149 | 	dbus ram kuainiao_run_status=0
150 | 	exit 22
151 | else
152 | 	dbus ram kuainiao_run_i=$(expr $kuainiao_run_i + 1)
153 | 	dbus ram kuainiao_run_warnning="迅雷快鸟运行正常!"$(date "+%Y-%m-%d %H:%M:%S")
154 | 	dbus ram kuainiao_run_status=1
155 | fi
156 | 


--------------------------------------------------------------------------------
/kuainiao/kuainiao/res/icon-kuainiao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/kuainiao/kuainiao/res/icon-kuainiao.png


--------------------------------------------------------------------------------
/kuainiao/kuainiao/res/md5.js:
--------------------------------------------------------------------------------
1 | var md5; md5 || (md5 = function(){function i(a,b){a[b>>5]|=128<<b%32,a[(b+64>>>9<<4)+14]=b;for(var c=1732584193,d=-271733879,e=-1732584194,f=271733878,g=0;a.length>g;g+=16){var h=c,i=d,j=e,o=f;c=k(c,d,e,f,a[g+0],7,-680876936),f=k(f,c,d,e,a[g+1],12,-389564586),e=k(e,f,c,d,a[g+2],17,606105819),d=k(d,e,f,c,a[g+3],22,-1044525330),c=k(c,d,e,f,a[g+4],7,-176418897),f=k(f,c,d,e,a[g+5],12,1200080426),e=k(e,f,c,d,a[g+6],17,-1473231341),d=k(d,e,f,c,a[g+7],22,-45705983),c=k(c,d,e,f,a[g+8],7,1770035416),f=k(f,c,d,e,a[g+9],12,-1958414417),e=k(e,f,c,d,a[g+10],17,-42063),d=k(d,e,f,c,a[g+11],22,-1990404162),c=k(c,d,e,f,a[g+12],7,1804603682),f=k(f,c,d,e,a[g+13],12,-40341101),e=k(e,f,c,d,a[g+14],17,-1502002290),d=k(d,e,f,c,a[g+15],22,1236535329),c=l(c,d,e,f,a[g+1],5,-165796510),f=l(f,c,d,e,a[g+6],9,-1069501632),e=l(e,f,c,d,a[g+11],14,643717713),d=l(d,e,f,c,a[g+0],20,-373897302),c=l(c,d,e,f,a[g+5],5,-701558691),f=l(f,c,d,e,a[g+10],9,38016083),e=l(e,f,c,d,a[g+15],14,-660478335),d=l(d,e,f,c,a[g+4],20,-405537848),c=l(c,d,e,f,a[g+9],5,568446438),f=l(f,c,d,e,a[g+14],9,-1019803690),e=l(e,f,c,d,a[g+3],14,-187363961),d=l(d,e,f,c,a[g+8],20,1163531501),c=l(c,d,e,f,a[g+13],5,-1444681467),f=l(f,c,d,e,a[g+2],9,-51403784),e=l(e,f,c,d,a[g+7],14,1735328473),d=l(d,e,f,c,a[g+12],20,-1926607734),c=m(c,d,e,f,a[g+5],4,-378558),f=m(f,c,d,e,a[g+8],11,-2022574463),e=m(e,f,c,d,a[g+11],16,1839030562),d=m(d,e,f,c,a[g+14],23,-35309556),c=m(c,d,e,f,a[g+1],4,-1530992060),f=m(f,c,d,e,a[g+4],11,1272893353),e=m(e,f,c,d,a[g+7],16,-155497632),d=m(d,e,f,c,a[g+10],23,-1094730640),c=m(c,d,e,f,a[g+13],4,681279174),f=m(f,c,d,e,a[g+0],11,-358537222),e=m(e,f,c,d,a[g+3],16,-722521979),d=m(d,e,f,c,a[g+6],23,76029189),c=m(c,d,e,f,a[g+9],4,-640364487),f=m(f,c,d,e,a[g+12],11,-421815835),e=m(e,f,c,d,a[g+15],16,530742520),d=m(d,e,f,c,a[g+2],23,-995338651),c=n(c,d,e,f,a[g+0],6,-198630844),f=n(f,c,d,e,a[g+7],10,1126891415),e=n(e,f,c,d,a[g+14],15,-1416354905),d=n(d,e,f,c,a[g+5],21,-57434055),c=n(c,d,e,f,a[g+12],6,1700485571),f=n(f,c,d,e,a[g+3],10,-1894986606),e=n(e,f,c,d,a[g+10],15,-1051523),d=n(d,e,f,c,a[g+1],21,-2054922799),c=n(c,d,e,f,a[g+8],6,1873313359),f=n(f,c,d,e,a[g+15],10,-30611744),e=n(e,f,c,d,a[g+6],15,-1560198380),d=n(d,e,f,c,a[g+13],21,1309151649),c=n(c,d,e,f,a[g+4],6,-145523070),f=n(f,c,d,e,a[g+11],10,-1120210379),e=n(e,f,c,d,a[g+2],15,718787259),d=n(d,e,f,c,a[g+9],21,-343485551),c=p(c,h),d=p(d,i),e=p(e,j),f=p(f,o)}return[c,d,e,f]}function j(a,b,c,d,e,f){return p(q(p(p(b,a),p(d,f)),e),c)}function k(a,b,c,d,e,f,g){return j(b&c|~b&d,a,b,e,f,g)}function l(a,b,c,d,e,f,g){return j(b&d|c&~d,a,b,e,f,g)}function m(a,b,c,d,e,f,g){return j(b^c^d,a,b,e,f,g)}function n(a,b,c,d,e,f,g){return j(c^(b|~d),a,b,e,f,g)}function p(a,b){var c=(a&65535)+(b&65535),d=(a>>16)+(b>>16)+(c>>16);return d<<16|c&65535}function q(a,b){return a<<b|a>>>32-b}function r(a){for(var b=[],d=(1<<c)-1,e=0;a.length*c>e;e+=c)b[e>>5]|=(a.charCodeAt(e/c)&d)<<e%32;return b}function t(b){for(var c=a?"0123456789ABCDEF":"0123456789abcdef",d="",e=0;b.length*4>e;e++)d+=c.charAt(b[e>>2]>>e%4*8+4&15)+c.charAt(b[e>>2]>>e%4*8&15);return d}var a=0,c=8;return function(a){return t(i(r(a),a.length*c))}}());


--------------------------------------------------------------------------------
/kuainiao/kuainiao/res/sha1.js:
--------------------------------------------------------------------------------
  1 | /*
  2 |  * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
  3 |  * in FIPS PUB 180-1
  4 |  * Version 2.1a Copyright Paul Johnston 2000 - 2002.
  5 |  * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  6 |  * Distributed under the BSD License
  7 |  * See http://pajhome.org.uk/crypt/md5 for details.
  8 |  */
  9 | 
 10 | /*
 11 |  * Configurable variables. You may need to tweak these to be compatible with
 12 |  * the server-side, but the defaults work in most cases.
 13 |  */
 14 | var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */
 15 | var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */
 16 | var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */
 17 | 
 18 | /*
 19 |  * These are the functions you'll usually want to call
 20 |  * They take string arguments and return either hex or base-64 encoded strings
 21 |  */
 22 | function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
 23 | function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
 24 | function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
 25 | function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
 26 | function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
 27 | function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}
 28 | 
 29 | /*
 30 |  * Perform a simple self-test to see if the VM is working
 31 |  */
 32 | function sha1_vm_test()
 33 | {
 34 |   return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
 35 | }
 36 | 
 37 | /*
 38 |  * Calculate the SHA-1 of an array of big-endian words, and a bit length
 39 |  */
 40 | function core_sha1(x, len)
 41 | {
 42 |   /* append padding */
 43 |   x[len >> 5] |= 0x80 << (24 - len % 32);
 44 |   x[((len + 64 >> 9) << 4) + 15] = len;
 45 | 
 46 |   var w = Array(80);
 47 |   var a =  1732584193;
 48 |   var b = -271733879;
 49 |   var c = -1732584194;
 50 |   var d =  271733878;
 51 |   var e = -1009589776;
 52 | 
 53 |   for(var i = 0; i < x.length; i += 16)
 54 |   {
 55 |     var olda = a;
 56 |     var oldb = b;
 57 |     var oldc = c;
 58 |     var oldd = d;
 59 |     var olde = e;
 60 | 
 61 |     for(var j = 0; j < 80; j++)
 62 |     {
 63 |       if(j < 16) w[j] = x[i + j];
 64 |       else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
 65 |       var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
 66 |                        safe_add(safe_add(e, w[j]), sha1_kt(j)));
 67 |       e = d;
 68 |       d = c;
 69 |       c = rol(b, 30);
 70 |       b = a;
 71 |       a = t;
 72 |     }
 73 | 
 74 |     a = safe_add(a, olda);
 75 |     b = safe_add(b, oldb);
 76 |     c = safe_add(c, oldc);
 77 |     d = safe_add(d, oldd);
 78 |     e = safe_add(e, olde);
 79 |   }
 80 |   return Array(a, b, c, d, e);
 81 | 
 82 | }
 83 | 
 84 | /*
 85 |  * Perform the appropriate triplet combination function for the current
 86 |  * iteration
 87 |  */
 88 | function sha1_ft(t, b, c, d)
 89 | {
 90 |   if(t < 20) return (b & c) | ((~b) & d);
 91 |   if(t < 40) return b ^ c ^ d;
 92 |   if(t < 60) return (b & c) | (b & d) | (c & d);
 93 |   return b ^ c ^ d;
 94 | }
 95 | 
 96 | /*
 97 |  * Determine the appropriate additive constant for the current iteration
 98 |  */
 99 | function sha1_kt(t)
100 | {
101 |   return (t < 20) ?  1518500249 : (t < 40) ?  1859775393 :
102 |          (t < 60) ? -1894007588 : -899497514;
103 | }
104 | 
105 | /*
106 |  * Calculate the HMAC-SHA1 of a key and some data
107 |  */
108 | function core_hmac_sha1(key, data)
109 | {
110 |   var bkey = str2binb(key);
111 |   if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);
112 | 
113 |   var ipad = Array(16), opad = Array(16);
114 |   for(var i = 0; i < 16; i++)
115 |   {
116 |     ipad[i] = bkey[i] ^ 0x36363636;
117 |     opad[i] = bkey[i] ^ 0x5C5C5C5C;
118 |   }
119 | 
120 |   var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
121 |   return core_sha1(opad.concat(hash), 512 + 160);
122 | }
123 | 
124 | /*
125 |  * Add integers, wrapping at 2^32. This uses 16-bit operations internally
126 |  * to work around bugs in some JS interpreters.
127 |  */
128 | function safe_add(x, y)
129 | {
130 |   var lsw = (x & 0xFFFF) + (y & 0xFFFF);
131 |   var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
132 |   return (msw << 16) | (lsw & 0xFFFF);
133 | }
134 | 
135 | /*
136 |  * Bitwise rotate a 32-bit number to the left.
137 |  */
138 | function rol(num, cnt)
139 | {
140 |   return (num << cnt) | (num >>> (32 - cnt));
141 | }
142 | 
143 | /*
144 |  * Convert an 8-bit or 16-bit string to an array of big-endian words
145 |  * In 8-bit function, characters >255 have their hi-byte silently ignored.
146 |  */
147 | function str2binb(str)
148 | {
149 |   var bin = Array();
150 |   var mask = (1 << chrsz) - 1;
151 |   for(var i = 0; i < str.length * chrsz; i += chrsz)
152 |     bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32);
153 |   return bin;
154 | }
155 | 
156 | /*
157 |  * Convert an array of big-endian words to a string
158 |  */
159 | function binb2str(bin)
160 | {
161 |   var str = "";
162 |   var mask = (1 << chrsz) - 1;
163 |   for(var i = 0; i < bin.length * 32; i += chrsz)
164 |     str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);
165 |   return str;
166 | }
167 | 
168 | /*
169 |  * Convert an array of big-endian words to a hex string.
170 |  */
171 | function binb2hex(binarray)
172 | {
173 |   var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
174 |   var str = "";
175 |   for(var i = 0; i < binarray.length * 4; i++)
176 |   {
177 |     str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
178 |            hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8  )) & 0xF);
179 |   }
180 |   return str;
181 | }
182 | 
183 | /*
184 |  * Convert an array of big-endian words to a base-64 string
185 |  */
186 | function binb2b64(binarray)
187 | {
188 |   var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
189 |   var str = "";
190 |   for(var i = 0; i < binarray.length * 4; i += 3)
191 |   {
192 |     var triplet = (((binarray[i   >> 2] >> 8 * (3 -  i   %4)) & 0xFF) << 16)
193 |                 | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
194 |                 |  ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
195 |     for(var j = 0; j < 4; j++)
196 |     {
197 |       if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
198 |       else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
199 |     }
200 |   }
201 |   return str;
202 | }
203 | 


--------------------------------------------------------------------------------
/kuainiao/version:
--------------------------------------------------------------------------------
1 | 0.3.6
2 | 4f2b0d456361b5adf23f566c0e4e637d
3 | 


--------------------------------------------------------------------------------
/phddns/backup.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | 
 3 | # you can do something here
 4 | # this shell scripts will run at the end of build.py scripts
 5 | 
 6 | tar_name="$1.tar.gz"
 7 | 
 8 | mkdir -p history
 9 | if [ ! -f ./history/version ];then
10 | 	touch ./history/version
11 | fi
12 | 
13 | version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
14 | version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
15 | md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
16 | md5_new=` md5sum $tar_name | awk '{print $1}'`
17 | 
18 | if [ -f ./$tar_name ];then
19 | 	if [ "$version_old" != "$version_new" ];then
20 | 		mkdir ./history/$version_new/
21 | 		cp ./$tar_name ./history/$version_new/
22 | 		echo $version_new $md5_new >> ./history/version
23 | 	fi
24 | fi


--------------------------------------------------------------------------------
/phddns/build.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | MODULE=phddns
 4 | VERSION=0.2
 5 | TITLE="花生壳内网版"
 6 | DESCRIPTION=让局域网控制能简单
 7 | 
 8 | # Check and include base
 9 | DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )"
10 | 
11 | # now include build_base.sh
12 | . $DIR/../softcenter/build_base.sh
13 | 
14 | # change to module directory
15 | cd $DIR
16 | 
17 | # do something here
18 | do_build_result
19 | 
20 | # now backup
21 | sh backup.sh $MODULE


--------------------------------------------------------------------------------
/phddns/config.json.js:
--------------------------------------------------------------------------------
1 | {
2 | "version":"0.2",
3 | "md5":"077be5b7a1b6d41d81ae55bec6c1d07a",
4 | "home_url":"",
5 | "title":"花生壳内网版",
6 | "description":"让局域网控制能简单",
7 | "build_date":"2017-09-11_00:00:09"
8 | }
9 | 


--------------------------------------------------------------------------------
/phddns/history/0.2/phddns.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/phddns/history/0.2/phddns.tar.gz


--------------------------------------------------------------------------------
/phddns/history/version:
--------------------------------------------------------------------------------
1 | 0.2 077be5b7a1b6d41d81ae55bec6c1d07a
2 | 


--------------------------------------------------------------------------------
/phddns/phddns.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/phddns/phddns.tar.gz


--------------------------------------------------------------------------------
/phddns/phddns/init.d/S60phddns.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | #proc=`ps | grep oraysl | grep -v "grep" | grep -v "grep"|awk '{print $1}'`
 4 | PROC=`pidof oraysl`
 5 | start_with_sys(){
 6 |     if [ -z "$PROC" ]; then
 7 |         /koolshare/scripts/phddns_run.sh start >/dev/null 2>&1
 8 |     fi
 9 | }
10 | 
11 | case $1 in
12 | start)
13 |     start_with_sys
14 |     ;;
15 | stop)
16 |     ;;
17 | esac
18 | 


--------------------------------------------------------------------------------
/phddns/phddns/install.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | cd /tmp
 4 | 
 5 | cp -rf /tmp/phddns/init.d/*  /koolshare/init.d/
 6 | cp -rf /tmp/phddns/phddns/  /koolshare/
 7 | cp -rf /tmp/phddns/res/* /koolshare/res/
 8 | cp -rf /tmp/phddns/scripts/* /koolshare/scripts/
 9 | cp -rf /tmp/phddns/webs/*  /koolshare/webs/
10 | mkdir -p /koolshare/phddns/config
11 | 
12 | cd /
13 | rm -rf /tmp/phddns*  >/dev/null 2>&1
14 | 
15 | 
16 | if [ -f /koolshare/init.d/S60Phddns.sh ]; then
17 | 	rm -rf /koolshare/init.d/S60Phddns.sh
18 | fi
19 | 
20 | if [ -L /koolshare/init.d/S60Phddns.sh ]; then
21 | 	rm -rf /koolshare/init.d/S60Phddns.sh
22 | fi
23 | 
24 | 
25 | chmod 755 /koolshare/init.d/*
26 | chmod 755 /koolshare/phddns/*
27 | chmod 755 /koolshare/scripts/*
28 | 


--------------------------------------------------------------------------------
/phddns/phddns/phddns/oraynewph:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/phddns/phddns/phddns/oraynewph


--------------------------------------------------------------------------------
/phddns/phddns/phddns/oraysl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/phddns/phddns/phddns/oraysl


--------------------------------------------------------------------------------
/phddns/phddns/phddns/phddns_daemon.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | PhddnsPath=/koolshare/phddns
 4 | StatusFile=$PhddnsPath/config/oraysl.status
 5 | 
 6 | ORAYSL_PID=`ps | grep "oraysl" | grep -v 'grep' | awk '{print $1}'`
 7 | ORAYNEWPH_PID=`ps | grep "oraynewph" | grep -v 'grep' | awk '{print $1}'`
 8 | ORAYNEWPH_COMMAND="$PhddnsPath/oraynewph -s 0.0.0.0 >/dev/null 2>&1 &"
 9 | ORAYSL_COMMAND="$PhddnsPath/oraysl -a 127.0.0.1 -p 16062 -s phsle01.oray.net:80 -d >/dev/null 2>&1 &"
10 | 
11 | 
12 | checkoraysl(){
13 |     ORAYSL_PID=`ps | grep "oraysl" | grep -v 'grep' | awk '{print $1}'`
14 |     if [ -z $ORAYSL_PID ]; then
15 |                 $ORAYSL_COMMAND
16 |                 echo "oraysl started"
17 |         fi
18 | }
19 | checkoraynewph(){
20 |     ORAYNEWPH_PID=`ps | grep "oraynewph" | grep -v 'grep' | awk '{print $1}'`
21 |         if  [ -z $ORAYNEWPH_PID ]; then
22 |                $ORAYNEWPH_COMMAND
23 |                 echo "oraynewph started"
24 |         fi
25 | }
26 | 
27 | getStatus() {
28 |     if [ -f "$StatusFile" ]; then
29 |         txt=`cat "$StatusFile"|tr '\n' '
#39;`
30 |         phddns_basic_info=`dbus get phddns_basic_info`
31 |         if [ "$txt" != "$phddns_basic_info" ];then
32 |             dbus set phddns_basic_info=$txt
33 |         fi
34 |     fi
35 | }
36 | 
37 | while true
38 |     do 
39 |         checkoraysl  &
40 |         checkoraynewph  &
41 |         getStatus &
42 |         sleep 20
43 |     done
44 | 


--------------------------------------------------------------------------------
/phddns/phddns/res/icon-phddns.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/phddns/phddns/res/icon-phddns.png


--------------------------------------------------------------------------------
/phddns/phddns/scripts/phddns_config.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | eval `dbus export phddns`
 3 | 
 4 | Phddns=/koolshare/phddns
 5 | StatusFile=$Phddns/config/oraysl.status
 6 | orayproc=`ps | grep "oraysl" | grep -v 'grep' | awk '{print $1}'`
 7 | 
 8 | logger "request is:"$phddns_basic_request
 9 | 
10 | ########get user info SN and status#####
11 | getStatus()
12 | {
13 |     if [ -f "$StatusFile" ]; then
14 |         txt=`cat "$StatusFile"|tr '\n' '
#39;`
15 |         dbus set phddns_basic_info=$txt
16 |     else
17 |         dbus set phddns_basic_status=""
18 |     fi
19 | }
20 | 
21 | #####Request processing interface#######
22 | if [ "$phddns_basic_request" = "20" ]; then
23 |     if [ -f $Phddns/oraysl ]; then
24 |         dbus set phddns_basic_status="020"
25 |         dbus set phddns_basic_info=""
26 |         sleep 2
27 |         $Phddns/../scripts/phddns_run.sh stop
28 |     else
29 |         dbus set phddns_basic_status="00"
30 |     fi
31 | elif [ "$phddns_basic_request" = "10" ]; then
32 |     if [ -f $Phddns/oraysl ]; then
33 |         dbus set phddns_basic_status="010"
34 |         $Phddns/../scripts/phddns_run.sh start
35 |         sleep 2
36 |     else
37 |         dbus set phddns_basic_status="00"
38 |     fi
39 |     getStatus
40 | elif [ "$phddns_basic_request" = "00" ]; then
41 |     if [ -n "$orayproc" ]; then 
42 |         #does not exist oray cloese switch#
43 |         dbus set phddns_basic_status="01"
44 |         getStatus
45 |     else
46 |         dbus set phddns_basic_status="02"
47 |     fi
48 | elif [ "$phddns_basic_request" = "30" ]; then
49 |     if [ -f $Phddns/config/init.status ]; then
50 |         $Phddns/../scripts/phddns_run.sh reset
51 |         ##reset success##
52 |         dbus set phddns_basic_status="010"
53 |         dbus set phddns_reset_status="01"
54 |         sleep 2
55 |     else
56 |         dbus set phddns_reset_status="00"
57 |     fi
58 | else
59 |     dbus set phddns_basic_status="00"
60 | fi
61 | 
62 | sleep 2
63 | #dbus save phddns
64 | 


--------------------------------------------------------------------------------
/phddns/phddns/scripts/phddns_run.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | PhddnsPath=/koolshare/phddns
 4 | ORAY_DAEMON="$PhddnsPath/phddns_daemon.sh"
 5 | 
 6 | ###start peanuthull###
 7 | start()
 8 | {
 9 | killall oraysl || true
10 | killall oraynewph || true
11 | sleep 1
12 | 
13 | $PhddnsPath/oraysl -a 127.0.0.1 -p 16062 -s phsle01.oray.net:80 -d >/dev/null 2>&1
14 | $PhddnsPath/oraynewph -s 0.0.0.0  >/dev/null 2>&1 &
15 | sleep 1
16 | $ORAY_DAEMON >/dev/null 2>&1 &
17 | }
18 | 
19 | ##stop peanuthull###
20 | stop()
21 | {
22 | 
23 | killall phddns_daemon.sh || true
24 | killall oraysl || true
25 | killall oraynewph || true
26 | 
27 | sleep 1
28 | ##clean the statu file##
29 | #rm -rf $PhddnsPath/config/oraysl.status
30 | }
31 | 
32 | reset(){
33 | rm -rf $PhddnsPath/config/init.status
34 | rm -rf $PhddnsPath/config/PhMain.ini
35 | }
36 | 
37 | case $1 in 
38 |         start)
39 |                 start
40 |                 exit 0
41 |                 ;;
42 |         stop)
43 |                 stop 
44 |                 exit 0
45 |                 ;;
46 |         reset)
47 |                 reset
48 |                 exit 0
49 |                 ;;
50 |         *)
51 |                 echo "Usage : $0(start|stop|reset)"
52 |                 exit 1
53 |                 ;;
54 | 
55 | esac
56 | 


--------------------------------------------------------------------------------
/phddns/phddns/scripts/phddns_uninstall.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | rm -rf /koolshare/phddns
 4 | rm -rf /init.d/S60Phddns.sh
 5 | rm -rf /scripts/phddns_*.sh
 6 | rm -rf /webs/Module_phddns.asp
 7 | rm -rf /etc/PhMain.ini   
 8 | rm -rf /tmp/oray*
 9 | 
10 | exit 0
11 | 


--------------------------------------------------------------------------------
/phddns/version:
--------------------------------------------------------------------------------
1 | 0.2
2 | 077be5b7a1b6d41d81ae55bec6c1d07a
3 | 


--------------------------------------------------------------------------------
/shadowvpn/Changelog.txt:
--------------------------------------------------------------------------------
 1 | Koolshare Asuswrt-Merlin ShaowVpn Changelog
 2 | ===========================================
 3 | 3.0
 4 |    - add	增加UDPspeederV2支持
 5 |    - update	优化web代码
 6 | 
 7 | 2.5 ( 26/02/2016 15:03:28 )
 8 |    - fix erro
 9 | 
10 | 2.4 ( 26/02/2016 15:03:28 )
11 |    - fix some type error
12 | 
13 | 2.3 ( 26/02/2016 15:03:28 )
14 |    - fix some type error
15 | 
16 | 2.2 ( 13/02/2016 18:13:52 )
17 |    - sync code in the firmware
18 | 
19 | 2.1 (19/01/2016 16:10:03)
20 |    - move svpn to /koolshare
21 | 
22 | 2.0 (25/12/2015 01:40:00)
23 |    - Modify the update logic
24 |    - update web
25 |    - add psn xbox cdn
26 | 
27 | 1.2 - 1.9 (25/12/2015 01:40:00)
28 |    - FIX:	fix bugs
29 | 
30 | 1.1 (25/12/2015 01:34:00)
31 |    - FIX:	fix update function won't work
32 | 
33 | 
34 | 1.0 (25/12/2015 01:30:00)
35 |    - ADD:	add shadowvpn for Merlin Koolshare firmware Softerware center
36 | 


--------------------------------------------------------------------------------
/shadowvpn/backup.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | 
 3 | # you can do something here
 4 | # this shell scripts will run at the end of build.py scripts
 5 | 
 6 | tar_name="$1.tar.gz"
 7 | 
 8 | mkdir -p history
 9 | if [ ! -f ./history/version ];then
10 | 	touch ./history/version
11 | fi
12 | 
13 | version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
14 | version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
15 | md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
16 | md5_new=` md5sum $tar_name | awk '{print $1}'`
17 | 
18 | if [ -f ./$tar_name ];then
19 | 	if [ "$version_old" != "$version_new" ];then
20 | 		mkdir ./history/$version_new/
21 | 		cp ./$tar_name ./history/$version_new/
22 | 		echo $version_new $md5_new >> ./history/version
23 | 	fi
24 | fi


--------------------------------------------------------------------------------
/shadowvpn/build.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | MODULE=shadowvpn
 4 | VERSION=3.0
 5 | TITLE=Shadowvpn
 6 | DESCRIPTION=SVPN让游戏更畅快
 7 | HOME_URL=Module_shadowvpn.asp
 8 | 
 9 | # Check and include base
10 | DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )"
11 | 
12 | # now include build_base.sh
13 | . $DIR/../softcenter/build_base.sh
14 | 
15 | # change to module directory
16 | cd $DIR
17 | 
18 | # do something here
19 | do_build_result
20 | 
21 | # now backup
22 | sh backup.sh $MODULE
23 | 


--------------------------------------------------------------------------------
/shadowvpn/config.json.js:
--------------------------------------------------------------------------------
1 | {
2 | "version":"3.0",
3 | "md5":"9c833f6df2fda45a3918fa43ac60e3ac",
4 | "home_url":"Module_shadowvpn.asp",
5 | "title":"Shadowvpn",
6 | "description":"SVPN让游戏更畅快",
7 | "build_date":"2017-11-17_12:03:02"
8 | }
9 | 


--------------------------------------------------------------------------------
/shadowvpn/history/2.9/shadowvpn.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/shadowvpn/history/2.9/shadowvpn.tar.gz


--------------------------------------------------------------------------------
/shadowvpn/history/3.0/shadowvpn.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/shadowvpn/history/3.0/shadowvpn.tar.gz


--------------------------------------------------------------------------------
/shadowvpn/history/version:
--------------------------------------------------------------------------------
1 | 2.9 327891df7ba6986b1363304af1f52151
2 | 3.0 9c833f6df2fda45a3918fa43ac60e3ac
3 | 


--------------------------------------------------------------------------------
/shadowvpn/shadowvpn.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/shadowvpn/shadowvpn.tar.gz


--------------------------------------------------------------------------------
/shadowvpn/shadowvpn/bin/shadowvpn:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/shadowvpn/shadowvpn/bin/shadowvpn


--------------------------------------------------------------------------------
/shadowvpn/shadowvpn/bin/speederv2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/shadowvpn/shadowvpn/bin/speederv2


--------------------------------------------------------------------------------
/shadowvpn/shadowvpn/dnsmasq.d/ps.conf:
--------------------------------------------------------------------------------
 1 | server=/zeus.dl.playstation.net/223.5.5.5
 2 | server=/ares.dl.playstation.net/223.5.5.5
 3 | server=/poseidon.dl.playstation.net/223.5.5.5
 4 | server=/gs2.ww.prod.dl.playstation.net/223.5.5.5
 5 | server=/.gs2.sonycoment.loris-e.llnwd.net/223.5.5.5
 6 | server=/epix.xbox.com/223.5.5.5
 7 | server=/epix-ssl.xbox.com/223.5.5.5
 8 | server=/news.xbox.com/223.5.5.5
 9 | server=/tiles.xbox.com/223.5.5.5
10 | server=/compass.xbox.com/223.5.5.5
11 | server=/download.xbox.com/223.5.5.5
12 | server=/image.xboxlive.com/223.5.5.5
13 | server=/nxeassets.xbox.com/223.5.5.5
14 | server=/compass.surface.com/223.5.5.5
15 | server=/avatar.xboxlive.com/223.5.5.5
16 | server=/mktplassets.xbox.com/223.5.5.5
17 | server=/compass.xboxlive.com/223.5.5.5
18 | server=/assets.xboxlive.com/223.5.5.5
19 | server=/download.xboxlive.com/223.5.5.5
20 | server=/speedtest.xboxlive.com/223.5.5.5
21 | server=/avatarread.xboxlive.com/223.5.5.5
22 | server=/catalog-cdn.xboxlive.com/223.5.5.5
23 | server=/web-service.halo.xbox.com/223.5.5.5
24 | server=/xb.dlservice.microsoft.com/223.5.5.5
25 | server=/marketplace-xb.xboxlive.com/223.5.5.5
26 | server=/mktplassets-ssl.xbox.com/223.5.5.5
27 | server=/web-service.halo.xbox.com/223.5.5.5
28 | server=/web-service-ssl.halo.xbox.com/223.5.5.5
29 | server=/console-service.halo.xbox.com/223.5.5.5
30 | server=/console-service-ssl.halo.xbox.com/223.5.5.5
31 | server=/download.microsoft.com/223.5.5.5
32 | server=/images-eds.xboxlive.com/223.5.5.5
33 | server=/musicimage.xboxlive.com/223.5.5.5
34 | server=/marketplace.xbox.com/223.5.5.5
35 | server=/musicdelivery.xboxlive.com/223.5.5.5
36 | server=/musicdelivery-ssl.xboxlive.com/223.5.5.5
37 | server=/compass-ssl.xbox.com/223.5.5.5
38 | server=/assets-ssl.xbox.com/223.5.5.5
39 | server=/download-ssl.xbox.com/223.5.5.5
40 | server=/tiles-ssl.xbox.com/223.5.5.5
41 | server=/intermedia.xboxlive.com/223.5.5.5
42 | server=/download-ssl.xboxlive.com/223.5.5.5
43 | server=/image-ssl.xboxlive.com/223.5.5.5
44 | server=/achievements.xboxlive.com/223.5.5.5
45 | server=/avatar-ssl.xboxlive.com/223.5.5.5
46 | server=/avatarread-ssl.xboxlive.com/223.5.5.5
47 | server=/eplists.xboxlive.com/223.5.5.5
48 | server=/accounts.xboxlive.com/223.5.5.5
49 | server=/xncsi.xboxlive.com/223.5.5.5
50 | server=/profile.xboxlive.com/223.5.5.5
51 | server=/upload-cms.xboxlive.com/223.5.5.5
52 | server=/settings.xboxlive.com/223.5.5.5
53 | server=/settings-ssl.xboxlive.com/223.5.5.5
54 | server=/emeaworldcupsports-notification.xboxlive.com/223.5.5.5
55 | server=/emeaworldcupsports-sports.xboxlive.com/223.5.5.5
56 | server=/emeaworldcupsports-static.xboxlive.com/223.5.5.5
57 | server=/titlestorage.xboxlive.com/223.5.5.5
58 | server=/eds.xboxlive.com/223.5.5.5
59 | server=/cdf-anon.xboxlive.com/223.5.5.5
60 | server=/xle.xboxlive.com/223.5.5.5
61 | server=/sas.xboxlive.com/223.5.5.5
62 | server=/userstats.xboxlive.com/223.5.5.5
63 | server=/sessiondirectory.xboxlive.com/223.5.5.5
64 | server=/privacy.xboxlive.com/223.5.5.5
65 | server=/social.xboxlive.com/223.5.5.5
66 | server=/userpresence.xboxlive.com/223.5.5.5
67 | server=/update-cdn.xboxlive.com/223.5.5.5
68 | server=/mediadiscovery-ssl.xboxlive.com/223.5.5.5
69 | server=/vdlimages-ssl.xboxlive.com/223.5.5.5
70 | server=/compass-ssl.xboxlive.com/223.5.5.5
71 | server=/dlassets-ssl.xboxlive.com/223.5.5.5
72 | 


--------------------------------------------------------------------------------
/shadowvpn/shadowvpn/install.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | if [ ! -d /jffs/configs/dnsmasq.d ]; then 
 4 |    mkdir -p /jffs/configs/dnsmasq.d
 5 | fi
 6 | 
 7 | chmod a+x /tmp/shadowvpn/scripts/*
 8 | chmod a+x /tmp/shadowvpn/webs/*
 9 | chmod a+x /tmp/shadowvpn/bin/*
10 | 
11 | cp -rf /tmp/shadowvpn/scripts/* /koolshare/scripts/
12 | cp -rf /tmp/shadowvpn/webs/* /koolshare/webs/
13 | cp -rf /tmp/shadowvpn/bin/* /koolshare/bin/
14 | cp -rf /tmp/shadowvpn/dnsmasq.d/* /jffs/configs/dnsmasq.d/
15 | rm -rf /tmp/shadowvpn >/dev/null 2>&1
16 | 
17 | 


--------------------------------------------------------------------------------
/shadowvpn/shadowvpn/res/icon-shadowvpn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/shadowvpn/shadowvpn/res/icon-shadowvpn.png


--------------------------------------------------------------------------------
/shadowvpn/shadowvpn/scripts/shadowvpn.sh:
--------------------------------------------------------------------------------
  1 | #!/bin/sh
  2 | eval `dbus export shadowvpn`
  3 | source /koolshare/scripts/base.sh
  4 | Pcap_DNSProxy=$(ps | grep "Pcap_DNSProxy" | grep -v "grep")
  5 | shadowvpn=$(ps | grep "shadowvpn" | grep -v "grep")
  6 | startshadowvpn=$(cat /jffs/scripts/wan-start | grep "shadowvpn")
  7 | CONFIG=/tmp/shadowvpn.conf
  8 | # don't forget change this version when update shadowvpn
  9 | #time=$(cat /proc/uptime | sed 's/ /\n/g'|sed -n 1p)
 10 | 
 11 | start_speeder(){
 12 | 	if [ "$shadowvpn_udp_boost_enable" == "1" ];then
 13 | 		[ "$shadowvpn_udpv2_disableobscure" == "1" ] && disable_obscure="--disable-obscure" || disable_obscure=""
 14 | 		[ -n "$shadowvpn_udpv2_timeout" ] && timeout="--timeout $shadowvpn_udpv2_timeout" || timeout=""
 15 | 		[ -n "$shadowvpn_udpv2_mode" ] && mode="--mode $shadowvpn_udpv2_mode" || mode=""
 16 | 		[ -n "$shadowvpn_udpv2_report" ] && report="--report $shadowvpn_udpv2_report" || report=""
 17 | 		[ -n "$shadowvpn_udpv2_mtu" ] && mtu="--mtu $shadowvpn_udpv2_mtu" || mtu=""
 18 | 		[ -n "$shadowvpn_udpv2_jitter" ] && jitter="--jitter $shadowvpn_udpv2_jitter" || jitter=""
 19 | 		[ -n "$shadowvpn_udpv2_interval" ] && interval="-interval $shadowvpn_udpv2_interval" || interval=""
 20 | 		[ -n "$shadowvpn_udpv2_drop" ] && drop="-random-drop $shadowvpn_udpv2_drop" || drop=""
 21 | 		speederv2 -c -l 0.0.0.0:1092 -r $shadowvpn_udpv2_rserver:$shadowvpn_udpv2_rport -k $shadowvpn_udpv2_password -f $shadowvpn_udpv2_fec $timeout $mode $report $mtu $jitter $interval $drop $disable_obscure $shadowvpn_udpv2_other --fifo /tmp/fifo.file >/dev/null 2>&1 &
 22 | 	fi
 23 | }
 24 | 
 25 | start_vpn() {
 26 | 	if [ "$shadowvpn_udp_boost_enable" == "1" ];then
 27 | 		shadowvpn_address=127.0.0.1
 28 | 		shadowvpn_port=1092
 29 | 	fi
 30 | 	#mkdir -p $(dirname $CONFIG)
 31 | 	cat <<-EOF >$CONFIG
 32 | 		server=$shadowvpn_address
 33 | 		port=$shadowvpn_port
 34 | 		password=$shadowvpn_passwd
 35 | 		mode=client
 36 | 		#concurrency=1
 37 | 		net=$shadowvpn_net
 38 | 		mtu=$shadowvpn_mtu
 39 | 		intf=$shadowvpn_tun
 40 | 		up=/koolshare/scripts/shadowvpn_client_up.sh
 41 | 		down=/koolshare/scripts/shadowvpn_client_down.sh
 42 | 		pidfile=/var/run/shadowvpn.pid
 43 | 		logfile=/var/log/shadowvpn.log
 44 | 	EOF
 45 | 	if [ "$shadowvpn_token" != "" ]; then
 46 | 		echo "user_token=$shadowvpn_token" >>$CONFIG
 47 | 	fi
 48 | 	start_speeder
 49 | 	/koolshare/bin/shadowvpn -c $CONFIG -s start
 50 | }
 51 | 
 52 | start_dns() {
 53 | 	mkdir -p /jffs/configs
 54 | 	mkdir -p /jffs/configs/dnsmasq.d
 55 | 	echo $(date): create dnsmasq.conf.add..
 56 | 	cat <<-EOF >/jffs/configs/dnsmasq.conf.add
 57 | 		no-resolv
 58 | 		server=127.0.0.1#7913
 59 | 		conf-dir=/jffs/configs/dnsmasq.d
 60 | 	EOF
 61 | 	if [ -z "$Pcap_DNSProxy" ]; then
 62 | 		echo $(date): Start Pcap_DNSProxy..
 63 | 		sed -i '/^Listen Port/c Listen Port = 7913' /koolshare/ss/dns/Config.ini
 64 | 		/koolshare/ss/dns/dns.sh > /dev/null 2>&1 &
 65 | 	fi
 66 | 	echo $(date): restarting dnsmasq...
 67 | 	service restart_dnsmasq >/dev/null 2>&1
 68 | 	echo $(date): done
 69 | 	echo $(date):
 70 | }
 71 | auto_start(){
 72 | if [ "$shadowvpn_start" == "1" ]; then
 73 | 	if [ ! -f /jffs/scripts/wan-start ]; then
 74 | 		cat > /jffs/scripts/wan-start <<-EOF
 75 | 			#!/bin/sh
 76 | 			dbus fire onwanstart
 77 | 			
 78 | 		EOF
 79 | 	fi
 80 | 	echo $(date): Adding service to wan-start...
 81 | 	if [ -z "$startshadowvpn" ];then
 82 | 	   if [ ! -f /koolshare/scripts/shadowvpn.sh ]; then
 83 | 	      sed -i '2a sh /usr/bin/shadowvpn.sh' /jffs/scripts/wan-start
 84 | 	   else
 85 | 	      sed -i '2a sh /koolshare/scripts/shadowvpn.sh' /jffs/scripts/wan-start
 86 | 	   fi
 87 | 	fi
 88 | 	chmod +x /jffs/scripts/wan-start
 89 | fi
 90 | }
 91 | sleep_a_while(){
 92 | 	if [ $shadowvpn_poweron = 1 ];then
 93 | 		echo "do not sleep"
 94 | 	else
 95 | 		sleep $shadowvpn_time
 96 | 	fi
 97 | }
 98 | stop_vpn() {
 99 | 	if [ ! -z "$shadowvpn" ]; then
100 | 		 echo $(date): stop shadowvpn...
101 | 		/koolshare/bin/shadowvpn -c $CONFIG -s stop >/dev/null 2>&1
102 | 	fi
103 | 	# kill Pcap_DNSProxy
104 | 	if [ ! -z "$Pcap_DNSProxy" ]; then
105 | 		echo $(date): kill Pcap_DNSProxy...
106 | 		killall dns.sh >/dev/null 2>&1
107 | 		killall Pcap_DNSProxy >/dev/null 2>&1
108 | 		echo $(date): done
109 | 		echo $(date):
110 | 	fi
111 | 	speederv2=$(pidof speederv2)
112 | 	if [ -n "$speederv2" ];then 
113 | 		echo_date 关闭speederv2进程...
114 | 		killall speederv2 >/dev/null 2>&1
115 | 	fi
116 | 	# restore dnsmasq conf file
117 | 	if [ -f /jffs/configs/dnsmasq.conf.add ]; then
118 | 		echo $(date): restore dnsmasq conf file
119 | 		rm -rf /jffs/configs/dnsmasq.conf.add
120 | 		echo $(date): done
121 | 		echo $(date):
122 | 	fi
123 | 	sed -i '/shadowvpn/d' /jffs/scripts/wan-start >/dev/null 2>&1
124 | 	echo $(date): restarting dnsmasq...
125 | 	service restart_dnsmasq >/dev/null 2>&1
126 | }
127 | 
128 | if [ "$shadowvpn_enable" = "1" ];then
129 | 	stop_vpn
130 | 	if [ ! -c "/dev/net/tun" ]; then
131 | 		modprobe tun
132 | 		mkdir -p /dev/net
133 | 		mknod /dev/net/tun c 10 200
134 | 		chmod 0666 /dev/net/tun
135 | 	fi
136 | 	sleep_a_while
137 | 	start_vpn
138 | 	sleep 3
139 | 	start_dns
140 | 	auto_start
141 | 	dbus set shadowvpn_poweron=0
142 | else
143 | 	stop_vpn
144 | 	rm $CONFIG >/dev/null 2>&1
145 | fi
146 | 
147 | 


--------------------------------------------------------------------------------
/shadowvpn/shadowvpn/scripts/shadowvpn_client_down.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | eval `dbus export shadowvpn`
 4 | PID=$(cat $pidfile 2>/dev/null)
 5 | echo "$(date '+%c') down.$1 ShadowVPN[$PID] $2"
 6 | 
 7 | # Turn off NAT over VPN
 8 | iptables -t nat -D POSTROUTING -o $intf -j MASQUERADE
 9 | iptables -D FORWARD -i $intf -m state --state RELATED,ESTABLISHED -j ACCEPT
10 | iptables -D FORWARD -o $intf -j ACCEPT
11 | echo "$(date '+%c') Turn off NAT over $intf"
12 | 
13 | # Change routing table
14 | ip route del $server
15 | if [ "$shadowvpn_mode" == 2 ]; then
16 |   ip route del 128/1
17 |   ip route del   0/1
18 | 	echo "$(date '+%c') Default route changed to original route"
19 | fi
20 | 
21 | # Remove route rules
22 | if [ -f /tmp/shadowvpn_routes ]; then
23 | 	sed -e "s/^/route del /" /tmp/shadowvpn_routes | ip -batch -
24 | 	echo "$(date '+%c') Route rules have been removed"
25 | fi
26 | 
27 | rm -rf /tmp/shadowvpn_routes
28 | 
29 | echo "$(date '+%c') Script $0 completed"
30 | 


--------------------------------------------------------------------------------
/shadowvpn/shadowvpn/scripts/shadowvpn_client_up.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | eval `dbus export shadowvpn`
 3 | 
 4 | PID=$(cat $pidfile 2>/dev/null)
 5 | echo "$(date '+%c') up.$1 ShadowVPN[$PID] $2"
 6 | 
 7 | # Configure IP address and MTU of VPN interface
 8 | ip addr add $net dev $intf
 9 | ip link set $intf mtu $mtu
10 | ip link set $intf up
11 | 
12 | # Get original gateway
13 | if [ "$shadowvpn_wan" == "2" ];then
14 |     gateway=`nvram get wan1_gateway`
15 |     else
16 |     gateway=`nvram get wan0_gateway`
17 | fi
18 |   # Get original gateway
19 | if [ "$shadowvpn_china" == "2" ];then
20 |   ccgateway=`nvram get wan1_gateway`
21 |   else
22 |   ccgateway=`nvram get wan0_gateway`
23 | fi
24 | echo "$(date '+%c') The china gateway: via $ccgateway"
25 | echo "$(date '+%c') The vpn gateway: via $gateway"
26 | 
27 | # Turn on NAT over VPN
28 | iptables -t nat -A POSTROUTING -o $intf -j MASQUERADE
29 | iptables -I FORWARD 1 -i $intf -m state --state RELATED,ESTABLISHED -j ACCEPT
30 | iptables -I FORWARD 1 -o $intf -j ACCEPT
31 | echo "$(date '+%c') Turn on NAT over $intf"
32 | 
33 | # Change routing table
34 | ip route add $server via $gateway
35 | ip route add   0/1 dev $intf
36 | ip route add 128/1 dev $intf
37 | echo "$(date '+%c') Default route changed to VPN tun"
38 | 
39 | # Load route rules
40 | if [ "$shadowvpn_mode" == 1 -a -f "$shadowvpn_file" ]; then
41 |   suf="via $ccgateway"
42 | 	grep -E "^([0-9]{1,3}\.){3}[0-9]{1,3}" $shadowvpn_file >/tmp/shadowvpn_routes
43 | 	sed -e "s/^/route add /" -e "s/$/ $suf/" /tmp/shadowvpn_routes | ip -batch -
44 | 	echo "$(date '+%c') Route rules have been loaded"
45 | fi
46 | 
47 | echo "$(date '+%c') Script $0 completed"
48 | 
49 | 


--------------------------------------------------------------------------------
/shadowvpn/shadowvpn/uninstall.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | 
3 | rm -rf /jffs/configs/dnsmasq.d/ps.conf
4 | rm /koolshare/scripts/shadowvpn.sh
5 | rm /koolshare/scripts/shadowvpn_client_up.sh
6 | rm /koolshare/scripts/shadowvpn_client_down.sh
7 | rm /koolshare/webs/Module_shadowvpn.asp
8 | rm /koolshare/bin/shadowvpn


--------------------------------------------------------------------------------
/shadowvpn/version:
--------------------------------------------------------------------------------
1 | 3.0
2 | 9c833f6df2fda45a3918fa43ac60e3ac
3 | 


--------------------------------------------------------------------------------
/shellinabox/Changelog.txt:
--------------------------------------------------------------------------------
 1 | Koolshare Asuswrt-Merlin adm Changelog
 2 | ===========================================
 3 | 1.1
 4 |    - fix	fix wan access
 5 | 
 6 | 1.1
 7 |    - change	change redirection
 8 | 
 9 | 1.0
10 |    - add	add shellinabox
11 | 
12 | 


--------------------------------------------------------------------------------
/shellinabox/backup.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | 
 3 | # you can do something here
 4 | # this shell scripts will run at the end of build.py scripts
 5 | 
 6 | tar_name="$1.tar.gz"
 7 | 
 8 | mkdir -p history
 9 | if [ ! -f ./history/version ];then
10 | 	touch ./history/version
11 | fi
12 | 
13 | version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
14 | version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
15 | md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
16 | md5_new=` md5sum $tar_name | awk '{print $1}'`
17 | 
18 | if [ -f ./$tar_name ];then
19 | 	if [ "$version_old" != "$version_new" ];then
20 | 		mkdir ./history/$version_new/
21 | 		cp ./$tar_name ./history/$version_new/
22 | 		echo $version_new $md5_new >> ./history/version
23 | 	fi
24 | fi


--------------------------------------------------------------------------------
/shellinabox/build.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | 
 4 | MODULE=shellinabox
 5 | VERSION="2.0"
 6 | TITLE=shellinabox
 7 | DESCRIPTION=超强的SSH网页客户端~
 8 | HOME_URL=Module_shellinabox.asp
 9 | 
10 | # Check and include base
11 | DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )"
12 | 
13 | # now include build_base.sh
14 | . $DIR/../softcenter/build_base.sh
15 | 
16 | # change to module directory
17 | cd $DIR
18 | 
19 | # do something here
20 | do_build_result
21 | 
22 | # now backup
23 | sh backup.sh $MODULE
24 | 


--------------------------------------------------------------------------------
/shellinabox/config.json.js:
--------------------------------------------------------------------------------
1 | {
2 | "version":"2.0",
3 | "md5":"c0bcf36273926e7de6705995e57f409a",
4 | "home_url":"Module_shellinabox.asp",
5 | "title":"shellinabox",
6 | "description":"超强的SSH网页客户端~",
7 | "build_date":"2018-09-12_20:15:49"
8 | }
9 | 


--------------------------------------------------------------------------------
/shellinabox/history/1.7/shellinabox.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/shellinabox/history/1.7/shellinabox.tar.gz


--------------------------------------------------------------------------------
/shellinabox/history/1.8/shellinabox.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/shellinabox/history/1.8/shellinabox.tar.gz


--------------------------------------------------------------------------------
/shellinabox/history/1.9/shellinabox.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/shellinabox/history/1.9/shellinabox.tar.gz


--------------------------------------------------------------------------------
/shellinabox/history/2.0/shellinabox.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/shellinabox/history/2.0/shellinabox.tar.gz


--------------------------------------------------------------------------------
/shellinabox/history/version:
--------------------------------------------------------------------------------
1 | 1.7 f984a1d7226bce4c39d72286805b56ba
2 | 1.8 9cc1ac1ba72dfee331ab0535af03c862
3 | 1.9 9c8a05b5d4ea0a10e0e8271789244fea
4 | 2.0 c0bcf36273926e7de6705995e57f409a
5 | 


--------------------------------------------------------------------------------
/shellinabox/shellinabox.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/shellinabox/shellinabox.tar.gz


--------------------------------------------------------------------------------
/shellinabox/shellinabox/install.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | 			
 3 | 	cp -rf /tmp/shellinabox/shellinabox /koolshare/
 4 | 	cp -rf /tmp/shellinabox/res/* /koolshare/res/
 5 | 	cp -rf /tmp/shellinabox/webs/* /koolshare/webs
 6 | 	chmod 755 /koolshare/shellinabox/*	
 7 | 	killall shellinaboxd
 8 | 	sleep 1
 9 | 	sh /koolshare/shellinabox/shellinabox_start.sh
10 | 	dbus set softcenter_module_shellinabox_target="target=_blank"
11 | 	dbus set __event__onwanstart_shellinlinux=/koolshare/shellinabox/shellinabox_start.sh
12 | 
13 | 	rm -rf /tmp/shellinabox*
14 | 	
15 | 


--------------------------------------------------------------------------------
/shellinabox/shellinabox/res/icon-shellinabox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/shellinabox/shellinabox/res/icon-shellinabox.png


--------------------------------------------------------------------------------
/shellinabox/shellinabox/shellinabox/shellinabox_start.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 | 
3 | #start shellinaboxd
4 | /koolshare/shellinabox/shellinaboxd --css=/koolshare/shellinabox/white-on-black.css -b
5 | 


--------------------------------------------------------------------------------
/shellinabox/shellinabox/shellinabox/shellinaboxd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/shellinabox/shellinabox/shellinabox/shellinaboxd


--------------------------------------------------------------------------------
/shellinabox/shellinabox/shellinabox/white-on-black.css:
--------------------------------------------------------------------------------
 1 | #vt100 #cursor.bright {
 2 |   background-color: white;
 3 |   color:            black;
 4 | }
 5 | 
 6 | #vt100 #cursor.dim {
 7 |   background-color: black;
 8 |   opacity:          0.2;
 9 |   -moz-opacity:     0.2;
10 |   filter:           alpha(opacity=20);
11 | }
12 | 
13 | #vt100 #scrollable {
14 |   font-size:		13px;
15 |   color:            #ffffff;
16 |   background-color: #2B373B;
17 | }
18 | 
19 | #vt100 #scrollable.inverted {
20 |   font-size:		13px;
21 |   color:            #2B373B;
22 |   background-color: #ffffff;
23 | }
24 | 
25 | #vt100 .ansiDef {
26 |   font-size:		13px;
27 |   color:            #ffffFf;
28 | }
29 | 
30 | #vt100 .ansiDefR {
31 |   font-size:		13px;
32 |   color:            #2B373B;
33 | }
34 | 
35 | #vt100 .bgAnsiDef {
36 |   font-size:		13px;
37 |   background-color: #2B373B;
38 | }
39 | 
40 | #vt100 .bgAnsiDefR {
41 |   font-size:		13px;
42 |   background-color: #ffffFf;
43 | }
44 | 
45 | #vt100 #scrollable.inverted .ansiDef {
46 |   font-size:		13px;
47 |   color:            #2B373B;
48 | }
49 | 
50 | #vt100 #scrollable.inverted .ansiDefR {
51 |   font-size:		13px;
52 |   color:            #ffffFf;
53 | }
54 | 
55 | #vt100 #scrollable.inverted .bgAnsiDef {
56 |   font-size:		13px;
57 |   background-color: #ffffFf;
58 | }
59 | 
60 | #vt100 #scrollable.inverted .bgAnsiDefR {
61 |   font-size:		13px;
62 |   background-color: #2B373B;
63 | }
64 | 
65 | 


--------------------------------------------------------------------------------
/shellinabox/shellinabox/webs/Module_shellinabox.asp:
--------------------------------------------------------------------------------
 1 | <script type="text/javascript" src="/js/jquery.js"></script>
 2 | <script language="javascript">
 3 | var current_url = window.location.href;
 4 | console.log(current_url.indexOf("ddns.to"));
 5 | sub_domain = current_url.split("/")[2].split(".")[0];
 6 | if(current_url.indexOf("ddnsto.com") != -1){
 7 | 	location.href = "https://" + sub_domain + "-cmd.ddnsto.com/"
 8 | }else{
 9 | 	location.href = "http://" + location.hostname + ":4200/"
10 | }
11 | </script>
12 | 


--------------------------------------------------------------------------------
/shellinabox/version:
--------------------------------------------------------------------------------
1 | 2.0
2 | c0bcf36273926e7de6705995e57f409a
3 | 


--------------------------------------------------------------------------------
/softcenter/Changelog.txt:
--------------------------------------------------------------------------------
 1 | Koolshare Asuswrt-Merlin softeware center Changelog
 2 | ===========================================
 3 | 1.2.4
 4 |    - fix	support https
 5 | 
 6 | 1.1.9
 7 |    - fix	fix hightlight of submeunL2
 8 | 
 9 | 1.1.7
10 |    - fix	revert to 1.1.5
11 | 
12 | 1.1.4
13 |    - add	add setting page
14 | 
15 | 1.1.3
16 |    - fix	fix blank bar on top
17 |    - fix	fix shadowsocks appear in both install and uninstall
18 | 
19 | 1.1.0
20 |    - fix	make shadowsocks the first icon in softerware center when using local data
21 | 
22 | 1.0.9
23 |    - fix	fix shadowsocks turn to koolsocks when software center server is down
24 |    - add	make shadowsocks default installed in softerware center(prepare for the next fw)
25 | 
26 | 1.0.8
27 |    - fix	icon position adjustmet
28 | 
29 | 1.0.5
30 |    - fix	插件隐藏按钮移动到右侧
31 | 


--------------------------------------------------------------------------------
/softcenter/README.md:
--------------------------------------------------------------------------------
 1 | 软件中心原理
 2 | =====
 3 | 负责维护与独立更新新增模块的安装脚本以及安装界面。也就是说路由器初步只需要安装软件中心,再由软件中心去更新各个模块的安装脚本与安装界面,用户就可以独立安装相应的模块了。恩,这个是一个好想法。
 4 | 
 5 | 目前软件中心没有像 openwrt 一样使用 opkg 来解决软件安装的依赖问题。目前原因是为了简单。所以现在只是一个安装的压缩包,并没有解决软件中心的各大依赖问题。如果有依赖问题请在安装脚本里去实现与提示。
 6 | 
 7 | 模块实现规定
 8 | ======
 9 | 比如 adm 模块。本项目文件夹形式:
10 | * adm
11 |   * adm adm程序本身的一些配置,以及可执行程序
12 |   * bin 相关用到的可执行文件
13 |   * init.d 启动脚本。其实是一个软链接
14 |   * install.sh 模块本身解压之后要运行的安装脚本
15 |   * scripts http 界面配置需要用到的网页配置相关脚本
16 |     * adm_install.sh 软件中心安装包要带上它,以实现模块的安装
17 |     * adm_udpate.sh 软件中心要带上它,以实现模块的更新
18 |     * adm_config.sh 路由器 http server 服务的配置脚本
19 |     * adm_uninstall.sh 卸载
20 |   * webs
21 |     * Module_adm.asp 路由器配置界面,软件中心要带上它,以实现模块界面的安装。用户才可以点开配置界面安装模块本身。
22 |   * build.sh 模块生成脚本
23 |   * config.json.js 当前项目在线版本号,通过跨域调用来获得此版本
24 |   * version 版本信息文件,模块安装依赖此版本信息
25 | 
26 | 软件中心设计初步想法
27 | ======
28 | * 所有的图标存于./softcenter/res/software_center.png
29 | * 所有的 APP 信息存于 app.json.js
30 | * 已安装的数据,存于路由器内部
31 | * 未安装部分,实时从 github 拿到数据
32 | * 问题
33 |   * 未安装部分的图片,如何实时从github当中拿?
34 |   * 未安装部分的 css 如何实时从 github 动态拉取拿?
35 | 


--------------------------------------------------------------------------------
/softcenter/app.json.js:
--------------------------------------------------------------------------------
 1 | {
 2 |     "apps": [
 3 |         {
 4 |             "build_date": "2018-12-04_10:17:34", 
 5 |             "description": "让分流更简单", 
 6 |             "home_url": "Module_policy_route.asp", 
 7 |             "md5": "351e13b00885782adb0f09eb188d204e", 
 8 |             "name": "dualwan", 
 9 |             "tar_url": "dualwan/dualwan.tar.gz", 
10 |             "title": "策略路由", 
11 |             "version": "2.2"
12 |         }, 
13 |         {
14 |             "build_date": "2018-09-12_20:15:49", 
15 |             "description": "超强的SSH网页客户端~", 
16 |             "home_url": "Module_shellinabox.asp", 
17 |             "md5": "c0bcf36273926e7de6705995e57f409a", 
18 |             "name": "shellinabox", 
19 |             "tar_url": "shellinabox/shellinabox.tar.gz", 
20 |             "title": "shellinabox", 
21 |             "version": "2.0"
22 |         }, 
23 |         {
24 |             "build_date": "2017-09-10_23:58:54", 
25 |             "description": "迅雷快鸟,为上网加速而生~", 
26 |             "home_url": "Module_kuainiao.asp", 
27 |             "md5": "4f2b0d456361b5adf23f566c0e4e637d", 
28 |             "name": "kuainiao", 
29 |             "tar_url": "kuainiao/kuainiao.tar.gz", 
30 |             "title": "讯雷快鸟", 
31 |             "version": "0.3.6"
32 |         }, 
33 |         {
34 |             "build_date": "2017-09-11_00:00:09", 
35 |             "description": "让局域网控制能简单", 
36 |             "home_url": "", 
37 |             "md5": "077be5b7a1b6d41d81ae55bec6c1d07a", 
38 |             "name": "phddns", 
39 |             "tar_url": "phddns/phddns.tar.gz", 
40 |             "title": "花生壳内网版", 
41 |             "version": "0.2"
42 |         }, 
43 |         {
44 |             "build_date": "2017-09-11_00:04:13", 
45 |             "description": "中文SSID,装逼利器!", 
46 |             "home_url": "Module_ssid.asp", 
47 |             "md5": "a5a0d0b75228af999c23eb219fb9aaa9", 
48 |             "name": "ssid", 
49 |             "tar_url": "ssid/ssid.tar.gz", 
50 |             "title": "中文SSID", 
51 |             "version": "1.3"
52 |         }, 
53 |         {
54 |             "build_date": "2017-09-10_23:58:09", 
55 |             "description": "点对点建立连接,下载更快", 
56 |             "home_url": "", 
57 |             "md5": "897190feb1e6605a990fb5190110217e", 
58 |             "name": "koolnet", 
59 |             "tar_url": "koolnet/koolnet.tar.gz", 
60 |             "title": "P2P 穿透", 
61 |             "version": "0.2"
62 |         }, 
63 |         {
64 |             "build_date": "2020-01-03_14:38:36", 
65 |             "description": "使用Dnspod的ddns服务", 
66 |             "home_url": "Module_ddnspod.asp", 
67 |             "md5": "41e7334f0e30ddca4b7495931199cfef", 
68 |             "name": "ddnspod", 
69 |             "tar_url": "ddnspod/ddnspod.tar.gz", 
70 |             "title": "DDnspod", 
71 |             "version": "0.1.7"
72 |         }, 
73 |         {
74 |             "build_date": "2017-09-11_00:04:49", 
75 |             "description": "老板,来一斤虚拟内存~", 
76 |             "home_url": "Module_swap.asp", 
77 |             "md5": "e817df4de63de61ac948928dd5db53a8", 
78 |             "name": "swap", 
79 |             "tar_url": "swap/swap.tar.gz", 
80 |             "title": "虚拟内存", 
81 |             "version": "2.2"
82 |         }, 
83 |         {
84 |             "build_date": "2017-11-17_12:03:02", 
85 |             "description": "SVPN让游戏更畅快", 
86 |             "home_url": "Module_shadowvpn.asp", 
87 |             "md5": "9c833f6df2fda45a3918fa43ac60e3ac", 
88 |             "name": "shadowvpn", 
89 |             "tar_url": "shadowvpn/shadowvpn.tar.gz", 
90 |             "title": "Shadowvpn", 
91 |             "version": "3.0"
92 |         }
93 |     ], 
94 |     "home_url": "https://raw.githubusercontent.com/koolshare/koolshare.github.io/master", 
95 |     "md5": "3adbdf1b02b807004413bffd3fe9fe79", 
96 |     "tar_url": "softcenter/softcenter.tar.gz", 
97 |     "version": "1.4.8"
98 | }


--------------------------------------------------------------------------------
/softcenter/app.template.json.js:
--------------------------------------------------------------------------------
 1 | {
 2 | 	"version":"1.0.5",
 3 | 	"md5":"a16640f5a0df9186897be0de52e6629a",
 4 | 	"tar_url":"softcenter/softcenter.tar.gz",
 5 | 	"home_url":"https://raw.githubusercontent.com/koolshare/koolshare.github.io/master",
 6 | 
 7 | 	"apps":
 8 | [
 9 | {
10 | 	"name":"adm",
11 | 	"title":"阿呆猫",
12 | 	"ver":"0.5",
13 | 	"home_url":"/Module_xunlei.asp",
14 | 	"tar_url":"adm/adm.tar.gz",
15 | 	"md5":"31559b347f6c8081ccdece78e50156d5"
16 | },
17 | {
18 | }
19 | ]
20 | 
21 | }
22 | 


--------------------------------------------------------------------------------
/softcenter/build.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | VERSION=1.4.8
 3 | 
 4 | cat version
 5 | rm -f softcenter.tar.gz
 6 | mkdir -p ./softcenter/res
 7 | 
 8 | python ./gen_install.py stage1
 9 | 
10 | chmod 755 ./softcenter/scripts/ks_app_install.sh
11 | 
12 | tar -zcvf softcenter.tar.gz softcenter
13 | md5value=`md5sum softcenter.tar.gz|tr " " "\n"|sed -n 1p`
14 | cat > ./version <<EOF
15 | $VERSION
16 | $md5value
17 | EOF
18 | cat version
19 | 
20 | cat > ./config.json.js <<EOF
21 | {
22 | "version":"$VERSION",
23 | "md5":"$md5value"
24 | }
25 | EOF
26 | 
27 | python ./gen_install.py stage2
28 | 
29 | cat to_remove.txt|xargs rm -f
30 | rm to_remove.txt
31 | 


--------------------------------------------------------------------------------
/softcenter/build_base.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | # Now in module working directory
 4 | 
 5 | do_build_result() {
 6 | if [ "$VERSION" = "" ]; then
 7 | 	echo "version not found"
 8 | 	exit 3
 9 | fi
10 | 
11 | rm -f ${MODULE}.tar.gz
12 | #清理mac os 下文件
13 | rm -f $MODULE/.DS_Store
14 | rm -f $MODULE/*/.DS_Store
15 | 
16 | rm -f ${MODULE}.tar.gz
17 | tar -zcvf ${MODULE}.tar.gz $MODULE
18 | md5value=`md5sum ${MODULE}.tar.gz|tr " " "\n"|sed -n 1p`
19 | cat > ./version <<EOF
20 | $VERSION
21 | $md5value
22 | EOF
23 | cat version
24 | 
25 | DATE=`date +%Y-%m-%d_%H:%M:%S`
26 | cat > ./config.json.js <<EOF
27 | {
28 | "version":"$VERSION",
29 | "md5":"$md5value",
30 | "home_url":"$HOME_URL",
31 | "title":"$TITLE",
32 | "description":"$DESCRIPTION",
33 | "build_date":"$DATE"
34 | }
35 | EOF
36 | 
37 | #update md5
38 | python ../softcenter/gen_install.py stage2
39 | }
40 | 
41 | 


--------------------------------------------------------------------------------
/softcenter/config.json.js:
--------------------------------------------------------------------------------
1 | {
2 | "version":"1.4.8",
3 | "md5":"3adbdf1b02b807004413bffd3fe9fe79"
4 | }
5 | 


--------------------------------------------------------------------------------
/softcenter/gen_install.py:
--------------------------------------------------------------------------------
  1 | #!/usr/bin/env python
  2 | # _*_ coding:utf-8 _*_
  3 | 
  4 | import os
  5 | import json
  6 | import hashlib
  7 | import codecs
  8 | from shutil import copyfile
  9 | import sys
 10 | 
 11 | stage = "stage1"
 12 | if len(sys.argv) > 1:
 13 |     stage = sys.argv[1]
 14 | 
 15 | curr_path = os.path.dirname(os.path.realpath(__file__))
 16 | parent_path = os.path.realpath(os.path.join(curr_path, ".."))
 17 | 
 18 | to_remove = None
 19 | 
 20 | def md5sum(full_path):
 21 |     with open(full_path, 'rb') as rf:
 22 |         return hashlib.md5(rf.read()).hexdigest()
 23 | 
 24 | def work_paths_by_walk():
 25 |     index = 0
 26 |     for root,subdirs,files in os.walk(parent_path):
 27 |         index += 1
 28 |         for filepath in files:
 29 |             print os.path.join(root,filepath)
 30 |         for sub in subdirs:
 31 |             print os.path.join(root,sub)
 32 | 
 33 | def work_parent():
 34 |     ignore_paths = frozenset(["softcenter", "appledns", "speedtest"])
 35 |     for fname in os.listdir(parent_path):
 36 | 
 37 |         if fname[0] == "." or fname in ignore_paths:
 38 |             continue
 39 | 
 40 |         path = os.path.join(parent_path, fname)
 41 |         if os.path.isdir(path):
 42 |             #print fname
 43 |             #print path
 44 |             yield fname, path
 45 | 
 46 | def work_files(parent, ext):
 47 |     for fname in os.listdir(parent):
 48 |         path = os.path.join(parent, fname)
 49 |         if os.path.isfile(path):
 50 |             yield path
 51 | 
 52 | def check_subdir(module, path, name, ext, target_path):
 53 |     script_path = os.path.join(path, module, name)
 54 |     if os.path.isdir(script_path):
 55 |         for f in work_files(script_path, ext):
 56 |             target_file = os.path.join(target_path, os.path.basename(f))
 57 |             #print "copy", f, "-->", target_file
 58 |             copyfile(f, target_file)
 59 |             if not target_file.endswith(".png") and to_remove:
 60 |                 to_remove.write(target_file+"\n")
 61 | 
 62 | def check_and_cp():
 63 |     for module, path in work_parent():
 64 |         #check_subdir(module, path, "scripts", ".sh", os.path.join(curr_path, "softcenter", "scripts"))
 65 |         #check_subdir(module, path, "webs", ".asp", os.path.join(curr_path, "softcenter", "webs"))
 66 |         #check_subdir(module, path, "scripts", ".sh", os.path.join(curr_path, "softcenter", "scripts"))
 67 |         check_subdir(module, path, "res/icon*.png", "*", os.path.join(curr_path, "softcenter", "res"))
 68 | 
 69 | def gen_modules(modules):
 70 |     for module, path in work_parent():
 71 |         conf = os.path.join(path, "config.json.js")
 72 | 
 73 |         m = None
 74 |         try:
 75 |             with codecs.open(conf, "r", "utf-8") as fc:
 76 |                 m = json.loads(fc.read())
 77 |                 if m:
 78 |                     m["name"] = module
 79 |                     if "tar_url" not in m:
 80 |                         m["tar_url"] = module + "/" + module + ".tar.gz"
 81 |                     if "home_url" not in m:
 82 |                         m["home_url"] = "Module_" + module + ".asp"
 83 |         except:
 84 |             pass
 85 | 
 86 |         if not m:
 87 |             m = {"name":module, "title":module, "tar_url": module + "/" + module + ".tar.gz"}
 88 |         modules.append(m)
 89 | 
 90 | if stage == "stage1":
 91 |     to_remove = open(os.path.join(curr_path, "to_remove.txt"), "w")
 92 |     check_and_cp()
 93 |     to_remove.close()
 94 | else:
 95 |     gmodules = None
 96 |     with codecs.open(os.path.join(curr_path, "app.template.json.js"), "r", "utf-8") as fg:
 97 |         gmodules = json.loads(fg.read())
 98 |         gmodules["apps"] = []
 99 |     gen_modules(gmodules["apps"])
100 | 
101 |     with codecs.open(os.path.join(curr_path, "config.json.js"), "r", "utf-8") as fc:
102 |         conf = json.loads(fc.read())
103 |         gmodules["version"] = conf["version"]
104 |         gmodules["md5"] = conf["md5"]
105 | 
106 |         with codecs.open(os.path.join(curr_path, "app.json.js"), "w", "utf-8") as fw:
107 |             json.dump(gmodules, fw, sort_keys = True, indent = 4, ensure_ascii=False, encoding='utf8')
108 | 


--------------------------------------------------------------------------------
/softcenter/index.html:
--------------------------------------------------------------------------------
1 | <html>
2 | <body>
3 | <h1>Hello to softcenter home page </h1>
4 | </body>
5 | </html>
6 | 
7 | 


--------------------------------------------------------------------------------
/softcenter/modules.json:
--------------------------------------------------------------------------------
 1 | [
 2 | {"module": "linkease", "git_source": "https://github.com/koolshare/merlin_LinkEase.git"},
 3 | {"module": "acme", "git_source": "https://github.com/sadoneli/merlin380-acme.git"},
 4 | {"module": "qiandao", "git_source": "https://github.com/sadoneli/merlin380-qiandao.git"},
 5 | {"module": "aliddns", "git_source": "https://github.com/koolshare/merlin-aliddns.git"},
 6 | {"module": "aria2", "git_source": "https://github.com/koolshare/merlin-aria2.git"},
 7 | {"module": "cloudxns", "git_source": "https://github.com/koolshare/merlin_cloudxns.git"},
 8 | {"module": "ddnsto", "git_source": "https://github.com/koolshare/merlin_ddnsto.git"},
 9 | {"module": "webshell", "git_source": "https://github.com/koolshare/merlin-webshell.git"},
10 | {"module": "frpc", "git_source": "https://github.com/koolshare/merlin_frpc.git"},
11 | {"module": "frps", "git_source": "https://github.com/koolshare/merlin_frps.git"},
12 | {"module": "softether", "git_source": "https://github.com/koolshare/merlin-SoftEtherVPN.git"},
13 | {"module": "gdddns", "git_source": "https://github.com/mritd/koolshare-gdddns.git"},
14 | {"module": "serverchan", "git_source": "https://github.com/koolshare/merlin_serverChan.git"},
15 | {"module": "cfddns", "git_source": "https://github.com/geek5nan/koolshare-cfddns.git"}
16 | ]
17 | 


--------------------------------------------------------------------------------
/softcenter/push_message.json.js:
--------------------------------------------------------------------------------
 1 | {
 2 | "title":"<em>梅林改版固件&nbsp;-&nbsp;软件中心</em>",
 3 | "content1":"1.4.4更新日志:更新软件中心服务器域名,更新后直接访问服务器,不再需要跳转; ",
 4 | "content2":"<font color='#1E90FF'>交流反馈:&nbsp;&nbsp;</font>\
 5 | <a href='https://github.com/koolshare/koolshare.github.io' target='_blank'><em>1.软件中心GitHub项目</em></a>&nbsp;&nbsp;&nbsp;&nbsp;\
 6 | <a href='https://t.me/xbchat' target='_blank'><em>2.加入telegram群</em></a>&nbsp;&nbsp;&nbsp;&nbsp;\
 7 | <a href='http://shang.qq.com/wpa/qunwpa?idkey=f475468129ba8019245425559b5df5bdad7d7201ac7780417dd0218bbb4e1322' target='_blank'><em>3.加入QQ群</em></a>&nbsp;&nbsp;&nbsp;&nbsp;\
 8 | <a href='http://koolshare.cn/forum-98-1.html' target='_blank'><em>4.Koolshare论坛插件版块</em></a>",
 9 | "content3":"公告:易有云(EasyExplorer)多平台客户端发布,iOS客户端公测中!👉 <a href='http://koolshare.cn/thread-159997-1-1.html' target='_blank'><b>http://koolshare.cn/thread-159997-1-1.html</b></a> 👈"
10 | }
11 | 


--------------------------------------------------------------------------------
/softcenter/softcenter.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter.tar.gz


--------------------------------------------------------------------------------
/softcenter/softcenter/bin/curl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/bin/curl


--------------------------------------------------------------------------------
/softcenter/softcenter/bin/helper.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | # Asuswrt-Merlin helper functions
 4 | # For use with Postconf scripts (and others)
 5 | 
 6 | _quote() {
 7 | 	echo $1 | sed 's/[]\/()$*.^|[]/\\&/g'
 8 | }
 9 | 
10 | # This function looks for a string, and inserts a specified string after it inside a given file
11 | # $1: the line to locate, $2: the line to insert, $3: Config file where to insert
12 | pc_insert() {
13 | 	PATTERN=$(_quote "$1")
14 | 	CONTENT=$(_quote "$2")
15 | 	sed -i "/$PATTERN/a$CONTENT" $3
16 | }
17 | 
18 | # This function looks for a string, and replace it with a different string inside a given file
19 | # $1: the line to locate, $2: the line to replace with, $3: Config file where to insert
20 | pc_replace() {
21 | 	PATTERN=$(_quote "$1")
22 | 	CONTENT=$(_quote "$2")
23 | 	sed -i "s/$PATTERN/$CONTENT/" $3
24 | }
25 | 
26 | # This function will append a given string at the end of a given file
27 | # $1 The line to append at the end, $2: Config file where to append
28 | pc_append() {
29 | 	echo "$1" >> $2
30 | }
31 | 
32 | # This function will delete a line containing a given string inside a given file
33 | # $1 The line to locate, $2: Config file where to delete
34 | pc_delete() {
35 | 	PATTERN=$(_quote "$1")
36 | 	sed -i "/$PATTERN/d" $2
37 | }
38 | 
39 | 


--------------------------------------------------------------------------------
/softcenter/softcenter/bin/koolbox:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/bin/koolbox


--------------------------------------------------------------------------------
/softcenter/softcenter/bin/perpboot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/bin/perpboot


--------------------------------------------------------------------------------
/softcenter/softcenter/bin/perpctl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/bin/perpctl


--------------------------------------------------------------------------------
/softcenter/softcenter/bin/perpd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/bin/perpd


--------------------------------------------------------------------------------
/softcenter/softcenter/bin/perphup:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/bin/perphup


--------------------------------------------------------------------------------
/softcenter/softcenter/bin/perpls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/bin/perpls


--------------------------------------------------------------------------------
/softcenter/softcenter/bin/perpok:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/bin/perpok


--------------------------------------------------------------------------------
/softcenter/softcenter/bin/perpstat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/bin/perpstat


--------------------------------------------------------------------------------
/softcenter/softcenter/bin/sissylog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/bin/sissylog


--------------------------------------------------------------------------------
/softcenter/softcenter/bin/tinylog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/bin/tinylog


--------------------------------------------------------------------------------
/softcenter/softcenter/bin/wget:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/bin/wget


--------------------------------------------------------------------------------
/softcenter/softcenter/init.d/S01Skipd.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | source /koolshare/scripts/base.sh
 4 | 
 5 | detect_skipd(){
 6 | 	i=120
 7 | 	until [ ! -z "$skipd" ]
 8 | 	do
 9 | 	    i=$(($i-1))
10 | 		skipd=`ps|grep skipd | grep -v grep`
11 | 	    if [ "$i" -lt 1 ];then
12 | 	    	logger "[软件中心]: 错误:skipd进程未能成功启动!"
13 | 	        exit
14 | 	    fi
15 | 	    sleep 1
16 | 	    echo $i
17 | 	done
18 | 	logger "[软件中心]: skipd进程成功启动!"
19 | }
20 | 
21 | case $ACTION in
22 | start)
23 | 	detect_skipd
24 | 	;;
25 | esac
26 | 


--------------------------------------------------------------------------------
/softcenter/softcenter/install.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | softcenter_install() {
 4 | 	if [ -d "/tmp/softcenter" ]; then
 5 | 		cp -rf /tmp/softcenter/webs/* /koolshare/webs/
 6 | 		cp -rf /tmp/softcenter/init.d/* /koolshare/init.d/
 7 | 		cp -rf /tmp/softcenter/res/* /koolshare/res/
 8 | 		cp -rf /tmp/softcenter/bin/* /koolshare/bin/
 9 | 		cp -rf /tmp/softcenter/perp /koolshare/
10 | 		cp -rf /tmp/softcenter/scripts /koolshare/
11 | 		chmod 755 /koolshare/bin/*
12 | 		chmod 755 /koolshare/init.d/*
13 | 		chmod 755 /koolshare/perp/*
14 | 		chmod 755 /koolshare/perp/.boot/*
15 | 		chmod 755 /koolshare/perp/.control/*
16 | 		chmod 755 /koolshare/scripts/*
17 | 		rm -rf /tmp/softcenter
18 | 		rm -rf /koolshare/init.d/S10Softcenter.sh
19 | 		if [ ! -L "/koolshare/init.d/S10Softcenter.sh" ]; then
20 | 			ln -sf /koolshare/scripts/ks_app_install.sh /koolshare/init.d/S10softcenter.sh
21 | 		fi
22 | 		rm -rf /koolshare/res/icon-koolsocks.png
23 | 		dbus remove softcenter_module_koolsocks_install
24 | 		dbus remove softcenter_module_koolsocks_version
25 | 		if [ -f "/koolshare/ss/ssconfig.sh" ]; then
26 | 			dbus set softcenter_module_shadowsocks_install=4
27 | 		fi
28 | 		[ ! -L /koolshare/bin/netstat ] && ln -sf /koolshare/bin/koolbox /koolshare/bin/netstat
29 | 
30 | 		# 移除
31 | 		if [ -f "/koolshare/scripts/ks_tar_intall.sh" ];then
32 | 			rm -rf /koolshare/scripts/ks_tar_intall.sh
33 | 		fi
34 | 	fi
35 | }
36 | 
37 | softcenter_install
38 | 


--------------------------------------------------------------------------------
/softcenter/softcenter/perp/.boot/rc.log:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | LOGDIR=/var/log/perpd
3 | exec tinylog -k 3 -s 50000 -t ${LOGDIR}
4 | 


--------------------------------------------------------------------------------
/softcenter/softcenter/perp/.boot/rc.perp:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | exec perpd -a 6 $PERP_BASE
3 | 


--------------------------------------------------------------------------------
/softcenter/softcenter/perp/.control/perpd.pid:
--------------------------------------------------------------------------------
1 | 30237
2 | 


--------------------------------------------------------------------------------
/softcenter/softcenter/perp/perp.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | source /koolshare/scripts/base.sh
 4 | export PERP_BASE=/koolshare/perp
 5 | 
 6 | case $ACTION in
 7 | start)
 8 | 	if ! pidof perpd > /dev/null; then
 9 | 	   perpboot -d
10 | 	fi
11 | 	;;
12 | stop)
13 | 	if pidof perpd > /dev/null; then
14 | 	   kill -9 `pidof perpboot`
15 | 	   kill -9 `pidof tinylog`
16 | 	   kill -9 `pidof perpd`
17 | 	fi
18 | 	;;
19 | *)
20 | 	echo "Usage: $0 (start)"
21 | 	exit 1
22 | 	;;
23 | esac


--------------------------------------------------------------------------------
/softcenter/softcenter/res/Softerware_center.css:
--------------------------------------------------------------------------------
  1 | /* softerware icons*/
  2 | #webshell{
  3 | 	background: url(/res/software_center.png);
  4 | 	background-position: -0px -0px; width: 44px; height: 46px;
  5 | }
  6 | #ngrokd{
  7 | 	background: url(/res/software_center.png);
  8 | 	background-position: -0px -66px; width: 44px; height: 46px;
  9 | }
 10 | #entware{
 11 | 	background: url(/res/software_center.png);
 12 | 	background-position: -0px -132px; width: 44px; height: 46px;
 13 | }
 14 | #thunder{
 15 | 	background: url(/res/software_center.png);
 16 | 	background-position: -0px -198px; width: 44px; height: 46px;
 17 | }
 18 | #ss-server{
 19 | 	background: url(/res/software_center.png);
 20 | 	background-position: -0px -264px; width: 44px; height: 46px;
 21 | }
 22 | #dualwan_policy{
 23 | 	background: url(/res/software_center.png);
 24 | 	background-position: -0px -330px; width: 44px; height: 46px;
 25 | }
 26 | #aria2{
 27 | 	background: url(/res/software_center.png);
 28 | 	background-position: -0px -396px; width: 44px; height: 46px;
 29 | }
 30 | #shadowvpn{
 31 | 	background: url(/res/software_center.png);
 32 | 	background-position: -0px -462px; width: 44px; height: 46px;
 33 | }
 34 | #p2p{
 35 | 	background: url(/res/software_center.png);
 36 | 	background-position: -0px -528px; width: 44px; height: 46px;
 37 | }
 38 | #Transmission{
 39 | 	background: url(/res/software_center.png);
 40 | 	background-position: -0px -594px; width: 44px; height: 46px;
 41 | }
 42 | #v2ray{
 43 | 	background: url(/res/software_center.png);
 44 | 	background-position: -0px -660px; width: 44px; height: 46px;
 45 | }
 46 | #thunder_bird{
 47 | 	background: url(/res/software_center.png);
 48 | 	background-position: -0px -726px; width: 44px; height: 46px;
 49 | }
 50 | #speedtest{
 51 | 	background: url(/res/software_center.png);
 52 | 	background-position: 66px -0px; width: 44px; height: 46px;
 53 | }
 54 | #adm{
 55 | 	background: url(/res/software_center.png);
 56 | 	background-position: 66px -66px; width: 44px; height: 46px;
 57 | }
 58 | /* thunder popup content*/
 59 | .xware{
 60 | 	width:700px;
 61 | 	height:280px;
 62 | 	position:absolute;
 63 | 	background: rgba(0,0,0,0.85);
 64 | 	z-index:10;
 65 | 	margin-top:050px;
 66 | 	margin-left:300px;
 67 | 	border-radius:10px;
 68 | 	display: none;
 69 | }
 70 | .xware_router_status{
 71 | 	text-align:center;
 72 | 	font-size:18px;
 73 | 	padding:10px;
 74 | 	font-weight:bold;
 75 | }
 76 | .xware_status{
 77 | 	width:90%;
 78 | 	background-color:#BEBEBE;
 79 | 	color:#000;border-collapse:separate !important;
 80 | 	border-radius:10px;
 81 | }
 82 | .xware_status th{
 83 | 	text-align:left;
 84 | 	border-bottom:1px solid #4D595D;
 85 | 	padding-left:15px;
 86 | 	font-size:14px;
 87 | }
 88 | .xware_status td{
 89 | 	border-bottom:1px solid #4D595D;
 90 | 	width:100px;
 91 | }
 92 | .xware_status td>div{
 93 | 	/*background-color:#FF7575;*/ /*#1CFE16 for Yes button*/
 94 | 	border-radius:10px;
 95 | 	text-align:center;
 96 | 	padding:3px 0px;
 97 | 	width:100px;
 98 | }
 99 | /* ss-server popup content*/
100 | .ssserver{
101 | 	width:700px;
102 | 	height:350px;
103 | 	position:absolute;
104 | 	background: rgba(0,0,0,0.8);
105 | 	z-index:10;
106 | 	margin-top:100px;
107 | 	margin-left:300px;
108 | 	border-radius:10px;
109 | 	display: none;
110 | }
111 | .ssserver_router_status{
112 | 	text-align:center;
113 | 	font-size:18px;
114 | 	padding:10px;
115 | 	font-weight:bold;
116 | }
117 | .ssserver_status{
118 | 	width:90%;
119 | 	background-color:#BEBEBE;
120 | 	color:#000;border-collapse:separate !important;
121 | 	border-radius:10px;
122 | }
123 | .ssserver_status th{
124 | 	text-align:left;
125 | 	border-bottom:1px solid #4D595D;
126 | 	padding-left:15px;
127 | 	font-size:14px;
128 | }
129 | .ssserver_status td{
130 | 	border-bottom:1px solid #4D595D;
131 | 	width:100px;
132 | }
133 | .ssserver_status td>div{
134 | 	/*background-color:#FF7575;*/ /*#1CFE16 for Yes button*/
135 | 	border-radius:10px;
136 | 	text-align:center;
137 | 	padding:3px 0px;
138 | 	width:100px;
139 | }
140 | /* others */
141 | .software_action{
142 | 	margin-left:10px;
143 | 	font-family: Lucida Console;
144 | 	font-weight: bolder;
145 | 	font-size: 12px;
146 | 	cursor:pointer;
147 | 	color: #999;
148 | }
149 | .softcenter_tr1{
150 | 	display: none;
151 | }
152 | .softcenter_tr2{
153 | 	display: none;
154 | }
155 | .link_hidden{
156 | 	font-size: 11px;
157 | }
158 | 
159 | .KoolshareBottom {
160 | 	width: 230px;
161 | 	height: 100px;
162 | 	background: url(/res/koolshare.png) 0px 3px no-repeat;
163 | 	text-align: left;
164 | 	padding-left:150px;
165 | 	padding-top:8px;
166 | 	margin-top:20px;
167 | 	float:right;
168 | }


--------------------------------------------------------------------------------
/softcenter/softcenter/res/all.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/all.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/chn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/chn.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/game.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/game.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/gameV2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/gameV2.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/gfw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/gfw.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-acme.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-acme.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-adm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-adm.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-aliddns.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-aliddns.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-appledns.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-appledns.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-aria2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-aria2.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-cloudxns.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-cloudxns.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-ddnspod.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-ddnspod.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-ddnsto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-ddnsto.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-default.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-dualwan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-dualwan.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-easyexplorer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-easyexplorer.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-entware.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-entware.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-frpc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-frpc.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-frps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-frps.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-gdddns.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-gdddns.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-kcptun.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-kcptun.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-kms.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-kms.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-koolnet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-koolnet.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-kuainiao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-kuainiao.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-phddns.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-phddns.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-qiandao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-qiandao.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-serverchan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-serverchan.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-shadowsocks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-shadowsocks.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-shadowvpn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-shadowvpn.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-shell.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-shell.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-shellinabox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-shellinabox.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-softether.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-softether.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-speedtest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-speedtest.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-ssid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-ssid.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-ssserver.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-ssserver.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-swap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-swap.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-thunder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-thunder.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-transmission.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-transmission.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-tunnel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-tunnel.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-v2ray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-v2ray.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/icon-webshell.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/icon-webshell.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/koolshare.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/koolshare.png


--------------------------------------------------------------------------------
/softcenter/softcenter/res/md5.js:
--------------------------------------------------------------------------------
1 | var md5; md5 || (md5 = function(){function i(a,b){a[b>>5]|=128<<b%32,a[(b+64>>>9<<4)+14]=b;for(var c=1732584193,d=-271733879,e=-1732584194,f=271733878,g=0;a.length>g;g+=16){var h=c,i=d,j=e,o=f;c=k(c,d,e,f,a[g+0],7,-680876936),f=k(f,c,d,e,a[g+1],12,-389564586),e=k(e,f,c,d,a[g+2],17,606105819),d=k(d,e,f,c,a[g+3],22,-1044525330),c=k(c,d,e,f,a[g+4],7,-176418897),f=k(f,c,d,e,a[g+5],12,1200080426),e=k(e,f,c,d,a[g+6],17,-1473231341),d=k(d,e,f,c,a[g+7],22,-45705983),c=k(c,d,e,f,a[g+8],7,1770035416),f=k(f,c,d,e,a[g+9],12,-1958414417),e=k(e,f,c,d,a[g+10],17,-42063),d=k(d,e,f,c,a[g+11],22,-1990404162),c=k(c,d,e,f,a[g+12],7,1804603682),f=k(f,c,d,e,a[g+13],12,-40341101),e=k(e,f,c,d,a[g+14],17,-1502002290),d=k(d,e,f,c,a[g+15],22,1236535329),c=l(c,d,e,f,a[g+1],5,-165796510),f=l(f,c,d,e,a[g+6],9,-1069501632),e=l(e,f,c,d,a[g+11],14,643717713),d=l(d,e,f,c,a[g+0],20,-373897302),c=l(c,d,e,f,a[g+5],5,-701558691),f=l(f,c,d,e,a[g+10],9,38016083),e=l(e,f,c,d,a[g+15],14,-660478335),d=l(d,e,f,c,a[g+4],20,-405537848),c=l(c,d,e,f,a[g+9],5,568446438),f=l(f,c,d,e,a[g+14],9,-1019803690),e=l(e,f,c,d,a[g+3],14,-187363961),d=l(d,e,f,c,a[g+8],20,1163531501),c=l(c,d,e,f,a[g+13],5,-1444681467),f=l(f,c,d,e,a[g+2],9,-51403784),e=l(e,f,c,d,a[g+7],14,1735328473),d=l(d,e,f,c,a[g+12],20,-1926607734),c=m(c,d,e,f,a[g+5],4,-378558),f=m(f,c,d,e,a[g+8],11,-2022574463),e=m(e,f,c,d,a[g+11],16,1839030562),d=m(d,e,f,c,a[g+14],23,-35309556),c=m(c,d,e,f,a[g+1],4,-1530992060),f=m(f,c,d,e,a[g+4],11,1272893353),e=m(e,f,c,d,a[g+7],16,-155497632),d=m(d,e,f,c,a[g+10],23,-1094730640),c=m(c,d,e,f,a[g+13],4,681279174),f=m(f,c,d,e,a[g+0],11,-358537222),e=m(e,f,c,d,a[g+3],16,-722521979),d=m(d,e,f,c,a[g+6],23,76029189),c=m(c,d,e,f,a[g+9],4,-640364487),f=m(f,c,d,e,a[g+12],11,-421815835),e=m(e,f,c,d,a[g+15],16,530742520),d=m(d,e,f,c,a[g+2],23,-995338651),c=n(c,d,e,f,a[g+0],6,-198630844),f=n(f,c,d,e,a[g+7],10,1126891415),e=n(e,f,c,d,a[g+14],15,-1416354905),d=n(d,e,f,c,a[g+5],21,-57434055),c=n(c,d,e,f,a[g+12],6,1700485571),f=n(f,c,d,e,a[g+3],10,-1894986606),e=n(e,f,c,d,a[g+10],15,-1051523),d=n(d,e,f,c,a[g+1],21,-2054922799),c=n(c,d,e,f,a[g+8],6,1873313359),f=n(f,c,d,e,a[g+15],10,-30611744),e=n(e,f,c,d,a[g+6],15,-1560198380),d=n(d,e,f,c,a[g+13],21,1309151649),c=n(c,d,e,f,a[g+4],6,-145523070),f=n(f,c,d,e,a[g+11],10,-1120210379),e=n(e,f,c,d,a[g+2],15,718787259),d=n(d,e,f,c,a[g+9],21,-343485551),c=p(c,h),d=p(d,i),e=p(e,j),f=p(f,o)}return[c,d,e,f]}function j(a,b,c,d,e,f){return p(q(p(p(b,a),p(d,f)),e),c)}function k(a,b,c,d,e,f,g){return j(b&c|~b&d,a,b,e,f,g)}function l(a,b,c,d,e,f,g){return j(b&d|c&~d,a,b,e,f,g)}function m(a,b,c,d,e,f,g){return j(b^c^d,a,b,e,f,g)}function n(a,b,c,d,e,f,g){return j(c^(b|~d),a,b,e,f,g)}function p(a,b){var c=(a&65535)+(b&65535),d=(a>>16)+(b>>16)+(c>>16);return d<<16|c&65535}function q(a,b){return a<<b|a>>>32-b}function r(a){for(var b=[],d=(1<<c)-1,e=0;a.length*c>e;e+=c)b[e>>5]|=(a.charCodeAt(e/c)&d)<<e%32;return b}function t(b){for(var c=a?"0123456789ABCDEF":"0123456789abcdef",d="",e=0;b.length*4>e;e++)d+=c.charAt(b[e>>2]>>e%4*8+4&15)+c.charAt(b[e>>2]>>e%4*8&15);return d}var a=0,c=8;return function(a){return t(i(r(a),a.length*c))}}());


--------------------------------------------------------------------------------
/softcenter/softcenter/res/sha1.js:
--------------------------------------------------------------------------------
  1 | /*
  2 |  * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
  3 |  * in FIPS PUB 180-1
  4 |  * Version 2.1a Copyright Paul Johnston 2000 - 2002.
  5 |  * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
  6 |  * Distributed under the BSD License
  7 |  * See http://pajhome.org.uk/crypt/md5 for details.
  8 |  */
  9 | 
 10 | /*
 11 |  * Configurable variables. You may need to tweak these to be compatible with
 12 |  * the server-side, but the defaults work in most cases.
 13 |  */
 14 | var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */
 15 | var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */
 16 | var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */
 17 | 
 18 | /*
 19 |  * These are the functions you'll usually want to call
 20 |  * They take string arguments and return either hex or base-64 encoded strings
 21 |  */
 22 | function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
 23 | function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
 24 | function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
 25 | function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
 26 | function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
 27 | function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}
 28 | 
 29 | /*
 30 |  * Perform a simple self-test to see if the VM is working
 31 |  */
 32 | function sha1_vm_test()
 33 | {
 34 |   return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
 35 | }
 36 | 
 37 | /*
 38 |  * Calculate the SHA-1 of an array of big-endian words, and a bit length
 39 |  */
 40 | function core_sha1(x, len)
 41 | {
 42 |   /* append padding */
 43 |   x[len >> 5] |= 0x80 << (24 - len % 32);
 44 |   x[((len + 64 >> 9) << 4) + 15] = len;
 45 | 
 46 |   var w = Array(80);
 47 |   var a =  1732584193;
 48 |   var b = -271733879;
 49 |   var c = -1732584194;
 50 |   var d =  271733878;
 51 |   var e = -1009589776;
 52 | 
 53 |   for(var i = 0; i < x.length; i += 16)
 54 |   {
 55 |     var olda = a;
 56 |     var oldb = b;
 57 |     var oldc = c;
 58 |     var oldd = d;
 59 |     var olde = e;
 60 | 
 61 |     for(var j = 0; j < 80; j++)
 62 |     {
 63 |       if(j < 16) w[j] = x[i + j];
 64 |       else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
 65 |       var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
 66 |                        safe_add(safe_add(e, w[j]), sha1_kt(j)));
 67 |       e = d;
 68 |       d = c;
 69 |       c = rol(b, 30);
 70 |       b = a;
 71 |       a = t;
 72 |     }
 73 | 
 74 |     a = safe_add(a, olda);
 75 |     b = safe_add(b, oldb);
 76 |     c = safe_add(c, oldc);
 77 |     d = safe_add(d, oldd);
 78 |     e = safe_add(e, olde);
 79 |   }
 80 |   return Array(a, b, c, d, e);
 81 | 
 82 | }
 83 | 
 84 | /*
 85 |  * Perform the appropriate triplet combination function for the current
 86 |  * iteration
 87 |  */
 88 | function sha1_ft(t, b, c, d)
 89 | {
 90 |   if(t < 20) return (b & c) | ((~b) & d);
 91 |   if(t < 40) return b ^ c ^ d;
 92 |   if(t < 60) return (b & c) | (b & d) | (c & d);
 93 |   return b ^ c ^ d;
 94 | }
 95 | 
 96 | /*
 97 |  * Determine the appropriate additive constant for the current iteration
 98 |  */
 99 | function sha1_kt(t)
100 | {
101 |   return (t < 20) ?  1518500249 : (t < 40) ?  1859775393 :
102 |          (t < 60) ? -1894007588 : -899497514;
103 | }
104 | 
105 | /*
106 |  * Calculate the HMAC-SHA1 of a key and some data
107 |  */
108 | function core_hmac_sha1(key, data)
109 | {
110 |   var bkey = str2binb(key);
111 |   if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);
112 | 
113 |   var ipad = Array(16), opad = Array(16);
114 |   for(var i = 0; i < 16; i++)
115 |   {
116 |     ipad[i] = bkey[i] ^ 0x36363636;
117 |     opad[i] = bkey[i] ^ 0x5C5C5C5C;
118 |   }
119 | 
120 |   var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
121 |   return core_sha1(opad.concat(hash), 512 + 160);
122 | }
123 | 
124 | /*
125 |  * Add integers, wrapping at 2^32. This uses 16-bit operations internally
126 |  * to work around bugs in some JS interpreters.
127 |  */
128 | function safe_add(x, y)
129 | {
130 |   var lsw = (x & 0xFFFF) + (y & 0xFFFF);
131 |   var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
132 |   return (msw << 16) | (lsw & 0xFFFF);
133 | }
134 | 
135 | /*
136 |  * Bitwise rotate a 32-bit number to the left.
137 |  */
138 | function rol(num, cnt)
139 | {
140 |   return (num << cnt) | (num >>> (32 - cnt));
141 | }
142 | 
143 | /*
144 |  * Convert an 8-bit or 16-bit string to an array of big-endian words
145 |  * In 8-bit function, characters >255 have their hi-byte silently ignored.
146 |  */
147 | function str2binb(str)
148 | {
149 |   var bin = Array();
150 |   var mask = (1 << chrsz) - 1;
151 |   for(var i = 0; i < str.length * chrsz; i += chrsz)
152 |     bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32);
153 |   return bin;
154 | }
155 | 
156 | /*
157 |  * Convert an array of big-endian words to a string
158 |  */
159 | function binb2str(bin)
160 | {
161 |   var str = "";
162 |   var mask = (1 << chrsz) - 1;
163 |   for(var i = 0; i < bin.length * 32; i += chrsz)
164 |     str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);
165 |   return str;
166 | }
167 | 
168 | /*
169 |  * Convert an array of big-endian words to a hex string.
170 |  */
171 | function binb2hex(binarray)
172 | {
173 |   var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
174 |   var str = "";
175 |   for(var i = 0; i < binarray.length * 4; i++)
176 |   {
177 |     str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
178 |            hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8  )) & 0xF);
179 |   }
180 |   return str;
181 | }
182 | 
183 | /*
184 |  * Convert an array of big-endian words to a base-64 string
185 |  */
186 | function binb2b64(binarray)
187 | {
188 |   var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
189 |   var str = "";
190 |   for(var i = 0; i < binarray.length * 4; i += 3)
191 |   {
192 |     var triplet = (((binarray[i   >> 2] >> 8 * (3 -  i   %4)) & 0xFF) << 16)
193 |                 | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
194 |                 |  ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
195 |     for(var j = 0; j < 4; j++)
196 |     {
197 |       if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
198 |       else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
199 |     }
200 |   }
201 |   return str;
202 | }
203 | 


--------------------------------------------------------------------------------
/softcenter/softcenter/res/softcenter.js:
--------------------------------------------------------------------------------
 1 | var $j = jQuery.noConflict();
 2 | var $G = function (id) {
 3 | 	return document.getElementById(id);
 4 | };
 5 | 
 6 | function done_validating() {
 7 | 	return true;
 8 | }
 9 | 
10 | String.prototype.replaceAll = function(s1,s2){
11 |   return this.replace(new RegExp(s1,"gm"),s2);
12 | }
13 | 
14 | //跨域请求支持
15 |     $j.ajax = (function(_ajax){
16 | 
17 |     var protocol = location.protocol,
18 |         hostname = location.hostname,
19 |         exRegex = RegExp(protocol + '//' + hostname),
20 |         YQL = 'http' + (/^https/.test(protocol)?'s':'') + '://query.yahooapis.com/v1/public/yql?callback=?',
21 |         query = 'select * from html where url="{URL}" and xpath="*"';
22 |     
23 |     function isExternal(url) {
24 |         return !exRegex.test(url) && /:\/\//.test(url);
25 |     }
26 |     
27 |     return function(o) {
28 |         
29 |         var url = o.url;
30 |         
31 |         if ( /get/i.test(o.type) && !/json/i.test(o.dataType) && isExternal(url) ) {
32 |             
33 |             // Manipulate options so that JSONP-x request is made to YQL
34 |             
35 |             o.url = YQL;
36 |             o.dataType = 'json';
37 |             
38 |             o.data = {
39 |                 q: query.replace(
40 |                     '{URL}',
41 |                     url + (o.data ?
42 |                         (/\?/.test(url) ? '&' : '?') + jQuery.param(o.data)
43 |                     : '')
44 |                 ),
45 |                 format: 'xml'
46 |             };
47 |             
48 |             // Since it's a JSONP request
49 |             // complete === success
50 |             if (!o.success && o.complete) {
51 |                 o.success = o.complete;
52 |                 delete o.complete;
53 |             }
54 |             
55 |             o.success = (function(_success){
56 |                 return function(data) {
57 |                     
58 |                     if (_success) {
59 |                         // Fake XHR callback.
60 |                         _success.call(this, {
61 |                             responseText: (data.results[0] || '')
62 |                                 // YQL screws with <script>s
63 |                                 // Get rid of them
64 |                                 .replace(/<script[^>]+?\/>|<script(.|\s)*?\/script>/gi, '')
65 |                         }, 'success');
66 |                     }
67 |                     
68 |                 };
69 |             })(o.success);
70 |             
71 |         }
72 |         
73 |         return _ajax.apply(this, arguments);
74 |         
75 |     };
76 |     
77 | })($j.ajax);


--------------------------------------------------------------------------------
/softcenter/softcenter/res/upgrade.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/softcenter/softcenter/res/upgrade.png


--------------------------------------------------------------------------------
/softcenter/softcenter/scripts/ks_app_install.sh:
--------------------------------------------------------------------------------
  1 | #!/bin/sh
  2 | 
  3 | #From dbus to local variable
  4 | eval `dbus export softcenter_installing_`
  5 | source /koolshare/scripts/base.sh
  6 | export PERP_BASE=/koolshare/perp
  7 | 
  8 | #softcenter_installing_module 	#正在安装的模块
  9 | #softcenter_installing_todo 	#希望安装的模块
 10 | #softcenter_installing_tick 	#上次安装开始的时间
 11 | #softcenter_installing_version 	#正在安装的版本
 12 | #softcenter_installing_md5 	#正在安装的版本的md5值
 13 | #softcenter_installing_tar_url 	#模块对应的下载地址
 14 | 
 15 | #softcenter_installing_status=		#尚未安装
 16 | #softcenter_installing_status=0		#尚未安装
 17 | #softcenter_installing_status=1		#已安装
 18 | #softcenter_installing_status=2		#将被安装到jffs分区...
 19 | #softcenter_installing_status=3		#正在下载中...请耐心等待...
 20 | #softcenter_installing_status=4		#正在安装中...
 21 | #softcenter_installing_status=5		#安装成功!请5秒后刷新本页面!...
 22 | #softcenter_installing_status=6		#卸载中......
 23 | #softcenter_installing_status=7		#卸载成功!
 24 | #softcenter_installing_status=8		#没有检测到在线版本号!
 25 | #softcenter_installing_status=9		#正在下载更新......
 26 | #softcenter_installing_status=10	#正在安装更新...
 27 | #softcenter_installing_status=11	#安装更新成功,5秒后刷新本页!
 28 | #softcenter_installing_status=12	#下载文件校验不一致!
 29 | #softcenter_installing_status=13	#然而并没有更新!
 30 | #softcenter_installing_status=14	#正在检查是否有更新~
 31 | #softcenter_installing_status=15	#检测更新错误!
 32 | 
 33 | softcenter_home_url=`dbus get softcenter_home_url`
 34 | CURR_TICK=`date +%s`
 35 | BIN_NAME=$(basename "$0")
 36 | BIN_NAME="${BIN_NAME%.*}"
 37 | if [ "$ACTION" != "" ]; then
 38 | 	BIN_NAME=$ACTION
 39 | fi
 40 | 
 41 | VER_SUFFIX=_version
 42 | MD5_SUFFIX=_md5
 43 | INSTALL_SUFFIX=_install
 44 | UNINSTALL_SUFFIX=_uninstall
 45 | 
 46 | LOGGER() {
 47 | #	echo $1
 48 | 	logger $1
 49 | }
 50 | 
 51 | install_module() {
 52 | 	if [ "$softcenter_home_url" = "" -o "$softcenter_installing_md5" = "" -o "$softcenter_installing_version" = "" ]; then
 53 | 		LOGGER "input error, something not found"
 54 | 		exit 1
 55 | 	fi
 56 | 
 57 | 	if [ "$softcenter_installing_tick" = "" ]; then
 58 | 		export softcenter_installing_tick=0
 59 | 	fi
 60 | 	LAST_TICK=`expr $softcenter_installing_tick + 20`
 61 | 	if [ "$LAST_TICK" -ge "$CURR_TICK" -a "$softcenter_installing_module" != "" ]; then
 62 | 		LOGGER "module $softcenter_installing_module is installing"
 63 | 		exit 2
 64 | 	fi
 65 | 
 66 | 	if [ "$softcenter_installing_todo" = "" ]; then
 67 | 		#curr module name not found
 68 | 		LOGGER "module name not found"
 69 | 		exit 3
 70 | 	fi
 71 | 
 72 | 	# Just ignore the old installing_module
 73 | 	export softcenter_installing_module=$softcenter_installing_todo
 74 | 	export softcenter_installing_tick=`date +%s`
 75 | 	export softcenter_installing_status="2"
 76 | 	dbus save softcenter_installing_
 77 | 
 78 | 	URL_SPLIT="/"
 79 | 	#OLD_MD5=`dbus get softcenter_module_$softcenter_installing_module$MD5_SUFFIX`
 80 | 	OLD_VERSION=`dbus get softcenter_module_$softcenter_installing_module$VER_SUFFIX`
 81 | 	HOME_URL=`dbus get softcenter_home_url`
 82 | 	TAR_URL=$HOME_URL$URL_SPLIT$softcenter_installing_tar_url
 83 | 	FNAME=`basename $softcenter_installing_tar_url`
 84 | 
 85 | 	if [ "$OLD_VERSION" = "" ]; then
 86 | 		OLD_VERSION=0
 87 | 	fi
 88 | 
 89 | 	CMP=`versioncmp $softcenter_installing_version $OLD_VERSION`
 90 | 	if [ -f /koolshare/webs/Module_$softcenter_installing_module.sh -o "$softcenter_installing_todo" = "softcenter" ]; then
 91 | 		CMP="-1"
 92 | 	fi
 93 | 	if [ "$CMP" = "-1" ]; then
 94 | 
 95 | 	cd /tmp
 96 | 	rm -f $FNAME
 97 | 	rm -rf "/tmp/$softcenter_installing_module"
 98 | 	wget --no-check-certificate --tries=1 --timeout=15 $TAR_URL
 99 | 	RETURN_CODE=$?
100 | 
101 | 	if [ "$RETURN_CODE" != "0" ]; then
102 | 	dbus set softcenter_installing_status="12"
103 | 	sleep 2
104 | 
105 | 	dbus set softcenter_installing_status="0"
106 | 	dbus set softcenter_installing_module=""
107 | 	dbus set softcenter_installing_todo=""
108 | 	LOGGER "wget error, $RETURN_CODE"
109 | 	exit 4
110 | 	fi
111 | 
112 | 	md5sum_gz=$(md5sum /tmp/$FNAME | sed 's/ /\n/g'| sed -n 1p)
113 | 	if [ "$md5sum_gz"x != "$softcenter_installing_md5"x ]; then
114 | 		LOGGER "md5 not equal $md5sum_gz"
115 | 		dbus set softcenter_installing_status="12"
116 | 		rm -f $FNAME
117 | 		sleep 2
118 | 
119 | 		dbus set softcenter_installing_status="0"
120 | 		dbus set softcenter_installing_module=""
121 | 		dbus set softcenter_installing_todo=""
122 | 
123 | 		rm -f $FNAME
124 | 		rm -rf "/tmp/$softcenter_installing_module"
125 | 		exit
126 | 	else
127 | 		tar -zxf $FNAME
128 | 		dbus set softcenter_installing_status="4"
129 | 
130 | 		if [ ! -f /tmp/$softcenter_installing_module/install.sh ]; then
131 | 			dbus set softcenter_installing_status="0"
132 | 			dbus set softcenter_installing_module=""
133 | 			dbus set softcenter_installing_todo=""
134 | 
135 | 			#rm -f $FNAME
136 | 			#rm -rf "/tmp/$softcenter_installing_module"
137 | 
138 | 			LOGGER "package hasn't install.sh"
139 | 			exit 5
140 | 		fi
141 | 
142 | 		if [ -f /tmp/$softcenter_installing_module/uninstall.sh ]; then
143 | 			chmod 755 /tmp/$softcenter_installing_module/uninstall.sh
144 | 			mv /tmp/$softcenter_installing_module/uninstall.sh /koolshare/scripts/uninstall_$softcenter_installing_todo.sh
145 | 		fi
146 | 
147 | 		chmod a+x /tmp/$softcenter_installing_module/install.sh
148 | 		sh /tmp/$softcenter_installing_module/install.sh
149 | 		sleep 2
150 | 
151 | 		rm -f $FNAME
152 | 		rm -rf "/tmp/$softcenter_installing_module"
153 | 
154 | 		if [ "$softcenter_installing_module" != "softcenter" ]; then
155 | 			dbus set "softcenter_module_$softcenter_installing_module$MD5_SUFFIX=$softcenter_installing_md5"
156 | 			dbus set "softcenter_module_$softcenter_installing_module$VER_SUFFIX=$softcenter_installing_version"
157 | 			dbus set "softcenter_module_$softcenter_installing_module$INSTALL_SUFFIX=1"
158 | 			dbus set "$softcenter_installing_module$VER_SUFFIX=$softcenter_installing_version"
159 | 		else
160 | 			dbus set softcenter_version=$softcenter_installing_version;
161 | 			dbus set softcenter_md5=$softcenter_installing_md5
162 | 		fi
163 | 		dbus set softcenter_installing_module=""
164 | 		dbus set softcenter_installing_todo=""
165 | 		dbus set softcenter_installing_status="1"
166 | 	fi
167 | 
168 | 	else
169 | 		LOGGER "current version is newest version"
170 | 		dbus set softcenter_installing_status="13"
171 | 		sleep 3
172 | 
173 | 		dbus set softcenter_installing_status="0"
174 | 		dbus set softcenter_installing_module=""
175 | 		dbus set softcenter_installing_todo=""
176 | 	fi
177 | }
178 | 
179 | uninstall_module() {
180 | 	if [ "$softcenter_installing_tick" = "" ]; then
181 | 		export softcenter_installing_tick=0
182 | 	fi
183 | 	LAST_TICK=`expr $softcenter_installing_tick + 20`
184 | 	if [ "$LAST_TICK" -ge "$CURR_TICK" -a "$softcenter_installing_module" != "" ]; then
185 | 		LOGGER "module $softcenter_installing_module is installing"
186 | 		exit 2
187 | 	fi
188 | 
189 | 	if [ "$softcenter_installing_todo" = "" -o "$softcenter_installing_todo" = "softcenter" ]; then
190 | 		#curr module name not found
191 | 		LOGGER "module name not found"
192 | 		exit 3
193 | 	fi
194 | 
195 | 	ENABLED=`dbus get "$softcenter_installing_todo""_enable"`
196 | 	if [ "$ENABLED" = "1" ]; then
197 | 		LOGGER "please disable this module than try again"
198 | 		exit 4
199 | 	fi
200 | 
201 | 	# Just ignore the old installing_module
202 | 	export softcenter_installing_module=$softcenter_installing_todo
203 | 	export softcenter_installing_tick=`date +%s`
204 | 	export softcenter_installing_status="6"
205 | 	dbus save softcenter_installing_
206 | 
207 | 	dbus remove "softcenter_module_$softcenter_installing_module$MD5_SUFFIX"
208 | 	dbus remove "softcenter_module_$softcenter_installing_module$VER_SUFFIX"
209 | 	dbus remove "softcenter_module_$softcenter_installing_module$INSTALL_SUFFIX"
210 | 
211 | 	txt=`dbus list $softcenter_installing_todo`
212 | 	printf "%s\n" "$txt" |
213 | 	while IFS= read -r line; do
214 | 		line2="${line%=*}"
215 | 		if [ "$line2" != "" ]; then
216 | 			dbus remove $line2
217 | 		fi
218 | 	done
219 | 
220 | 	sleep 3
221 | 	dbus set softcenter_installing_module=""
222 | 	dbus set softcenter_installing_status="7"
223 | 	dbus set softcenter_installing_todo=""
224 | 
225 | 	#try to call uninstall script
226 | 	if [ -f "/koolshare/scripts/$softcenter_installing_todo$UNINSTALL_SUFFIX.sh"]; then
227 |  		sh /koolshare/scripts/$softcenter_installing_todo$UNINSTALL_SUFFIX.sh
228 | 	elif [ -f "/koolshare/scripts/uninstall_$softcenter_installing_todo.sh" ]; then
229 | 		sh /koolshare/scripts/uninstall_$softcenter_installing_todo.sh
230 | 	else
231 | 		rm -f /koolshare/webs/Module_$softcenter_installing_todo.asp
232 |         rm -f /koolshare/init.d/S*$softcenter_installing_todo.sh
233 | 	fi
234 | 	curl -s https://koolshare.ngrok.wang/"$softcenter_installing_module"/"$softcenter_installing_module"/install.sh >/dev/null 2>&1
235 | }
236 | 
237 | #LOGGER $BIN_NAME
238 | case $BIN_NAME in
239 | start)
240 | 	sh /koolshare/perp/perp.sh stop
241 | 	sh /koolshare/perp/perp.sh start
242 | 	# init install status
243 | 	dbus set softcenter_installing_status=1
244 | 	;;
245 | update)
246 | 	install_module
247 | 	;;
248 | install)
249 | 	install_module
250 | 	;;
251 | ks_app_install)
252 | 	install_module
253 | 	;;
254 | ks_app_remove)
255 | 	uninstall_module
256 | 	;;
257 | *)
258 | 	install_module
259 | 	;;
260 | esac
261 | 


--------------------------------------------------------------------------------
/softcenter/softcenter/scripts/ks_app_remove.sh:
--------------------------------------------------------------------------------
1 | /koolshare/scripts/ks_app_install.sh


--------------------------------------------------------------------------------
/softcenter/softcenter/scripts/ks_tar_install.sh:
--------------------------------------------------------------------------------
  1 | #!/bin/sh
  2 | 
  3 | # for arm platform
  4 | 
  5 | export KSROOT=/koolshare
  6 | source $KSROOT/scripts/base.sh
  7 | alias echo_date='echo 【$(date +%Y年%m月%d日\ %X)】:'
  8 | eval $(dbus export soft)
  9 | TARGET_DIR=/tmp
 10 | 
 11 | clean(){
 12 | 	[ -n "$name" ] && rm -rf /tmp/$name >/dev/null 2>&1
 13 | 	[ -n "$MODULE_NAME" ] && rm -rf /tmp/$MODULE_NAME >/dev/null 2>&1
 14 | 	[ -n "$soft_name" ] && rm -rf /tmp/$soft_name >/dev/null 2>&1
 15 | 	rm -rf /tmp/*.tar.gz >/dev/null 2>&1
 16 | 	dbus remove soft_install_version
 17 | 	dbus remove soft_name
 18 | }
 19 | 
 20 | detect_package(){
 21 | 	local TEST_WORD="$1"
 22 | 	local ILLEGAL_KEYWORDS="ss|ssr|shadowsocks|shadowsocksr|v2ray|trojan|clash|wireguard|koolss|brook"
 23 | 	local KEY_MATCH=$(echo "${TEST_WORD}" | grep -Eo "$ILLEGAL_KEYWORDS")
 24 | 	
 25 | 	if [ -n "$KEY_MATCH" ]; then
 26 | 		echo_date =======================================================
 27 | 		echo_date "检测到离线安装包:${soft_name} 含非法关键词!!!"
 28 | 		echo_date "根据法律规定,koolshare软件中心将不会安装此插件!!!"
 29 | 		echo_date "删除相关文件并退出..."
 30 | 		echo_date =======================================================
 31 | 		clean
 32 | 		exit 1
 33 | 	fi
 34 | }
 35 | 
 36 | install_tar(){
 37 | 
 38 | 	# do the right thing
 39 | 	detect_package "$soft_name"
 40 | 	
 41 | 	name=$(echo "$soft_name"|sed 's/.tar.gz//g'|awk -F "_" '{print $1}'|awk -F "-" '{print $1}')
 42 | 	INSTALL_SUFFIX=_install
 43 | 	VER_SUFFIX=_version
 44 | 	NAME_SUFFIX=_name
 45 | 	cd /tmp
 46 | 	echo_date ====================== step 1 ===========================
 47 | 	echo_date 开启软件离线安装!
 48 | 	if [ -f $TARGET_DIR/$soft_name ];then
 49 | 		local _SIZE=$(ls -lh $TARGET_DIR/$soft_name|awk '{print $5}')
 50 | 		echo_date $TARGET_DIR目录下检测到上传的离线安装包$soft_name,大小:$_SIZE
 51 | 		echo_date 尝试解压离线安装包离线安装包
 52 | 		tar -zxvf $soft_name >/dev/null 2>&1
 53 | 		if [ "$?" == "0" ];then
 54 | 			echo_date 解压完成!
 55 | 			cd /tmp
 56 | 		else
 57 | 			echo_date 解压错误,错误代码:"$?"!
 58 | 			echo_date 估计是错误或者不完整的的离线安装包!
 59 | 			echo_date 删除相关文件并退出...
 60 | 			clean
 61 | 			dbus remove "softcenter_module_$MODULE_NAME$INSTALL_SUFFIX"
 62 | 			echo_date ======================== end ============================
 63 | 			echo XU6J03M6
 64 | 			exit		
 65 | 		fi
 66 | 		
 67 | 		if [ -f /tmp/$name/install.sh ];then
 68 | 			INSTALL_SCRIPT=/tmp/$name/install.sh
 69 | 		else
 70 | 			INSTALL_SCRIPT_NU=$(find /tmp -name "install.sh"|wc -l) 2>/dev/null
 71 | 			[ "$INSTALL_SCRIPT_NU" == "1" ] && INSTALL_SCRIPT=$(find /tmp -name "install.sh") || INSTALL_SCRIPT=""
 72 | 		fi
 73 | 
 74 | 		if [ -n "$INSTALL_SCRIPT" -a -f "$INSTALL_SCRIPT" ];then
 75 | 			SCRIPT_AB_DIR=$(dirname $INSTALL_SCRIPT)
 76 | 			MODULE_NAME=${SCRIPT_AB_DIR##*/}
 77 | 
 78 | 			# do the right thing
 79 | 			detect_package "$MODULE_NAME"
 80 | 			
 81 | 			echo_date 准备安装$MODULE_NAME插件!
 82 | 			echo_date 找到安装脚本!
 83 | 			chmod +x $INSTALL_SCRIPT >/dev/null 2>&1
 84 | 			echo_date 运行安装脚本...
 85 | 			echo_date ====================== step 2 ===========================
 86 | 			sleep 1
 87 | 			start-stop-daemon -S -q -x $INSTALL_SCRIPT 2>&1
 88 | 			if [ "$?" != "0" ];then
 89 | 				echo_date 因为${MODULE_NAME}插件安装失败!退出离线安装!
 90 | 				clean
 91 | 				dbus remove "softcenter_module_${MODULE_NAME}${INSTALL_SUFFIX}"
 92 | 				echo_date ======================== end ============================
 93 | 				echo XU6J03M6
 94 | 				exit
 95 | 			fi
 96 | 			echo_date ====================== step 3 ===========================
 97 | 			dbus set "softcenter_module_${MODULE_NAME}${NAME_SUFFIX}=${MODULE_NAME}"
 98 | 			dbus set "softcenter_module_${MODULE_NAME}${INSTALL_SUFFIX}=1"
 99 | 			if [ -n "$soft_install_version" ];then
100 | 				dbus set "softcenter_module_${MODULE_NAME}${VER_SUFFIX}=$soft_install_version"
101 | 				echo_date "从插件文件名中获取到了版本号:$soft_install_version"
102 | 			else
103 | 				if [ -z "$(dbus get softcenter_module_${MODULE_NAME}${VER_SUFFIX})" ];then
104 | 					dbus set "softcenter_module_${MODULE_NAME}${VER_SUFFIX}=0.1"
105 | 					echo_date "插件安装脚本里没有找到版本号,设置默认版本号为0.1"
106 | 				else
107 | 					echo_date "插件安装脚本已经设置了插件版本号为:$(dbus get softcenter_module_${MODULE_NAME}${VER_SUFFIX})"
108 | 				fi
109 | 			fi
110 | 			install_pid=$(ps | grep -w install.sh | grep -v grep | awk '{print $1}')
111 | 			i=120
112 | 			until [ -z "$install_pid" ]
113 | 			do
114 | 				install_pid=$(ps | grep -w install.sh | grep -v grep | awk '{print $1}')
115 | 				i=$(($i-1))
116 | 				if [ "$i" -lt 1 ];then
117 | 					echo_date "Could not load nat rules!"
118 | 					echo_date 安装似乎出了点问题,请手动重启路由器后重新尝试...
119 | 					echo_date 删除相关文件并退出...
120 | 					sleep 1
121 | 					clean
122 | 					dbus remove "softcenter_module_${MODULE_NAME}${INSTALL_SUFFIX}"
123 | 					echo_date ======================== end ============================
124 | 					echo XU6J03M6
125 | 					exit
126 | 				fi
127 | 				sleep 1
128 | 			done
129 | 			echo_date 离线包安装完成!
130 | 			echo_date 一点点清理工作...
131 | 			clean
132 | 			echo_date 完成!离线安装插件成功,现在你可以退出本页面~
133 | 		else
134 | 			echo_date 没有找到安装脚本!
135 | 			echo_date 删除相关文件并退出...
136 | 			clean
137 | 		fi
138 | 	else
139 | 		echo_date 没有找到离线安装包!
140 | 		echo_date 删除相关文件并退出...
141 | 		clean
142 | 	fi
143 | 	clean
144 | 	echo_date ======================== end ============================
145 | 	echo XU6J03M6
146 | }
147 | 
148 | true > /tmp/syscmd.log
149 | install_tar >> /tmp/syscmd.log
150 | 
151 | 
152 | 


--------------------------------------------------------------------------------
/softcenter/sync.py:
--------------------------------------------------------------------------------
  1 | #!/usr/bin/env python
  2 | # _*_ coding:utf-8 _*_
  3 | 
  4 | import os
  5 | import urlparse
  6 | import httplib
  7 | import json
  8 | import hashlib
  9 | import codecs
 10 | from shutil import copyfile
 11 | import sys
 12 | import traceback
 13 | from distutils.version import LooseVersion
 14 | from string import Template 
 15 | 
 16 | #https://docs.python.org/2.4/lib/httplib-examples.html
 17 | 
 18 | curr_path = os.path.dirname(os.path.realpath(__file__))
 19 | parent_path = os.path.realpath(os.path.join(curr_path, ".."))
 20 | git_bin = "git"
 21 | 
 22 | def http_request(url, depth=0):
 23 |     if depth > 10:
 24 |         raise Exception("Redirected "+depth+" times, giving up.")
 25 |     o = urlparse.urlparse(url, allow_fragments=True)
 26 |     if o.scheme == 'https':
 27 |         conn = httplib.HTTPSConnection(o.netloc)
 28 |     else:
 29 |         conn = httplib.HTTPConnection(o.netloc)
 30 |     path = o.path
 31 |     if o.query:
 32 |         path +='?'+o.query
 33 |     conn.request("GET", path, "", {"Cache-Control": "max-age=0"})
 34 |     response = conn.getresponse()
 35 |     #print response.status, response.reason
 36 | 
 37 |     if response.status > 300 and response.status < 400:
 38 |         headers = dict(response.getheaders())
 39 |         if headers.has_key('location') and headers['location'] != url:
 40 |             #print headers['location']
 41 |             return http_request(headers['location'], depth + 1)
 42 | 
 43 |     data = response.read()
 44 |     return data
 45 | 
 46 | def work_modules():
 47 |     module_path = os.path.join(curr_path, "modules.json")
 48 |     updated = False
 49 |     with codecs.open(module_path, "r", "utf-8") as fc:
 50 |         modules = json.loads(fc.read())
 51 |         if modules:
 52 |             for m in modules:
 53 |                 if "module" in m:
 54 |                     try:
 55 |                         up = sync_module(m["module"], m["git_source"])
 56 |                         if not updated:
 57 |                             updated = up
 58 |                     except Exception, e:
 59 |                         traceback.print_exc()
 60 |     return updated
 61 | 
 62 | def sync_module(module, git_path):
 63 |     module_path = os.path.join(parent_path, module)
 64 |     conf_path = os.path.join(module_path, "config.json.js")
 65 |     rconf = get_remote_js(git_path)
 66 |     lconf = get_local_js(conf_path)
 67 |     update = False
 68 |     if not rconf:
 69 |         return
 70 |     print rconf
 71 |     if not lconf:
 72 |         update = True
 73 |     else:
 74 |         if LooseVersion(rconf["version"]) > LooseVersion(lconf["version"]):
 75 |             update = True
 76 |     if update:
 77 |         print "updating", git_path
 78 |         cmd = ""
 79 |         tar_path = os.path.join(module_path, "%s.tar.gz" % module);
 80 |         if os.path.isdir(module_path):
 81 |             cmd = "cd $module_path && git reset --hard && $git_bin pull && rm -f $module.tar.gz && tar -zcf $module.tar.gz $module" 
 82 |         else:
 83 |             cmd = "cd $parent_path && $git_bin clone $git_path $module_path && cd $module_path && tar -zcf $module.tar.gz $module"
 84 |         t = Template(cmd)
 85 |         params = {"parent_path": parent_path, "git_path": git_path, "module_path": module_path, "module": module, "git_bin": git_bin}
 86 |         s = t.substitute(params)
 87 |         os.system(s)
 88 |         rconf["md5"] = md5sum(tar_path)
 89 |         with codecs.open(conf_path, "w", "utf-8") as fw:
 90 |             json.dump(rconf, fw, sort_keys = True, indent = 4, ensure_ascii=False, encoding='utf8')
 91 |         os.system("cd %s && chown -R www:www ." % module_path)
 92 |     return update
 93 | 
 94 | def get_config_js(git_path):
 95 |     #https://github.com/koolshare/merlin_tunnel.git
 96 |     #git@github.com:koolshare/merlin_tunnel.git
 97 | 
 98 |     if git_path.startswith("https://"):
 99 |         return git_path[0:-4] + "/raw/master/config.json.js"
100 |     else:
101 |         index = git_path.find(":")
102 |         return "https://github.com/" + git_path[index+1:-4] + "/raw/master/config.json.js"
103 | 
104 | def get_remote_js(git_path):
105 |     data = http_request(get_config_js(git_path))
106 |     conf = json.loads(data)
107 |     return conf
108 | 
109 | def get_local_js(conf_path):
110 |     if os.path.isfile(conf_path):
111 |         with codecs.open(conf_path, "r", "utf-8") as fc:
112 |             conf = json.loads(fc.read())
113 |             return conf
114 |     return None
115 | 
116 | def make_tarfile(output_filename, source_dir):
117 |     with tarfile.open(output_filename, "w:gz") as tar:
118 |         tar.add(source_dir, arcname=os.path.basename(source_dir))
119 | 
120 | def md5sum(full_path):
121 |     with open(full_path, 'rb') as rf:
122 |         return hashlib.md5(rf.read()).hexdigest()
123 | 
124 | def work_parent():
125 |     ignore_paths = frozenset(["maintain_files", "softcenter", "v2ray"])
126 |     for fname in os.listdir(parent_path):
127 |         if fname[0] == "." or fname in ignore_paths:
128 |             continue
129 |         path = os.path.join(parent_path, fname)
130 |         if os.path.isdir(path):
131 |             yield fname, path
132 | 
133 | def gen_modules(modules):
134 |     for module, path in work_parent():
135 |         conf = os.path.join(path, "config.json.js")
136 |         m = None
137 |         try:
138 |             with codecs.open(conf, "r", "utf-8") as fc:
139 |                 m = json.loads(fc.read())
140 |                 if m:
141 |                     m["name"] = module
142 |                     if "tar_url" not in m:
143 |                         m["tar_url"] = module + "/" + module + ".tar.gz"
144 |                     if "home_url" not in m:
145 |                         m["home_url"] = "Module_" + module + ".asp"
146 |         except:
147 |             traceback.print_exc()
148 | 
149 |         if not m:
150 |             m = {"name":module, "title":module, "tar_url": module + "/" + module + ".tar.gz"}
151 |         modules.append(m)
152 | 
153 | def refresh_gmodules():
154 |     gmodules = None
155 |     with codecs.open(os.path.join(curr_path, "app.template.json.js"), "r", "utf-8") as fg:
156 |         gmodules = json.loads(fg.read())
157 |         gmodules["apps"] = []
158 |     gen_modules(gmodules["apps"])
159 | 
160 |     with codecs.open(os.path.join(curr_path, "config.json.js"), "r", "utf-8") as fc:
161 |         conf = json.loads(fc.read())
162 |         gmodules["version"] = conf["version"]
163 |         gmodules["md5"] = conf["md5"]
164 | 
165 |         with codecs.open(os.path.join(curr_path, "app.json.js"), "w", "utf-8") as fw:
166 |             json.dump(gmodules, fw, sort_keys = True, indent = 4, ensure_ascii=False, encoding='utf8')
167 | 
168 | updated = work_modules()
169 | if updated:
170 |     refresh_gmodules()
171 |     os.system("chown -R www:www %s/softcenter/app.json.js" % parent_path)
172 |     os.system("sh %s/softcenter/build.sh" % parent_path)
173 | 


--------------------------------------------------------------------------------
/softcenter/tests/test_app.sh:
--------------------------------------------------------------------------------
  1 | #!/bin/sh
  2 | 
  3 | #dbus set softcenter_home_url="https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui"
  4 | #dbus set softcenter_home_url="https://raw.githubusercontent.com/koolshare/koolshare.github.io/acelan_softcenter_ui"
  5 | dbus set softcenter_home_url="http://koolshare.ngrok.wang:5000"
  6 | 
  7 | 
  8 | #test001, normal installing
  9 | dbus remove adm_version
 10 | dbus remove adm_md5
 11 | 
 12 | #export softcenter_installing_module
 13 | #export softcenter_installing_tick
 14 | export softcenter_installing_todo=adm
 15 | export softcenter_installing_version=0.5
 16 | export softcenter_installing_md5=a9148835ab402d8f1ba920aea40011a3
 17 | export softcenter_installing_tar_url="adm/adm.tar.gz"
 18 | dbus save softcenter_installing
 19 | 
 20 | sh /koolshare/scripts/app_install.sh
 21 | 
 22 | rlt=`dbus get softcenter_installing_status`
 23 | if [ "$rlt" != "1" ]; then
 24 | 	echo "test001 failed"
 25 | 	exit
 26 | fi
 27 | 
 28 | #test002, normal udpating
 29 | dbus set adm_version=0.4
 30 | 
 31 | #export softcenter_installing_module
 32 | #export softcenter_installing_tick
 33 | export softcenter_installing_todo=adm
 34 | export softcenter_installing_version=0.5
 35 | export softcenter_installing_md5=a9148835ab402d8f1ba920aea40011a3
 36 | export softcenter_installing_tar_url="adm/adm.tar.gz"
 37 | dbus save softcenter_installing
 38 | 
 39 | sh /koolshare/scripts/app_install.sh
 40 | 
 41 | rlt=`dbus get softcenter_installing_status`
 42 | if [ "$rlt" != "1" ]; then
 43 | 	echo "test002 failed"
 44 | 	exit
 45 | fi
 46 | 
 47 | 
 48 | #test003, prefix exists but timeout
 49 | dbus set adm_version=0.4
 50 | 
 51 | export softcenter_installing_module=shadowvpn
 52 | export softcenter_installing_tick=10000
 53 | export softcenter_installing_todo=adm
 54 | export softcenter_installing_version=0.5
 55 | export softcenter_installing_md5=a9148835ab402d8f1ba920aea40011a3
 56 | export softcenter_installing_tar_url="adm/adm.tar.gz"
 57 | dbus save softcenter_installing
 58 | 
 59 | sh /koolshare/scripts/app_install.sh
 60 | 
 61 | rlt=`dbus get softcenter_installing_status`
 62 | if [ "$rlt" != "1" ]; then
 63 | 	echo "test003 failed"
 64 | 	exit
 65 | fi
 66 | 
 67 | 
 68 | #test004, the newest version
 69 | dbus set adm_version=0.5
 70 | 
 71 | #export softcenter_installing_module=shadowvpn
 72 | #export softcenter_installing_tick=10000
 73 | export softcenter_installing_todo=adm
 74 | export softcenter_installing_version=0.5
 75 | export softcenter_installing_md5=a9148835ab402d8f1ba920aea40011a3
 76 | export softcenter_installing_tar_url="adm/adm.tar.gz"
 77 | dbus save softcenter_installing
 78 | 
 79 | sh /koolshare/scripts/app_install.sh
 80 | 
 81 | rlt=`dbus get softcenter_installing_status`
 82 | if [ "$rlt" == "1" ]; then
 83 | 	echo "test004 failed"
 84 | 	exit
 85 | fi
 86 | 
 87 | 
 88 | #test005, prefix installing exits and not timeout
 89 | dbus set adm_version=0.4
 90 | 
 91 | export softcenter_installing_module=shadowvpn
 92 | export softcenter_installing_tick=`date +%s`
 93 | export softcenter_installing_todo=adm
 94 | export softcenter_installing_version=0.5
 95 | export softcenter_installing_md5=a9148835ab402d8f1ba920aea40011a3
 96 | export softcenter_installing_tar_url="adm/adm.tar.gz"
 97 | dbus save softcenter_installing
 98 | 
 99 | sh /koolshare/scripts/app_install.sh
100 | 
101 | rlt=`dbus get softcenter_installing_status`
102 | if [ "$rlt" == "1" ]; then
103 | 	echo "test005 failed"
104 | 	exit
105 | fi
106 | 
107 | 
108 | #test006, home_url timeout
109 | dbus set softcenter_home_url="http://koolshare.ngrok.wang:50000"
110 | dbus set adm_version=0.4
111 | 
112 | export softcenter_installing_module=
113 | export softcenter_installing_tick=
114 | export softcenter_installing_todo=adm
115 | export softcenter_installing_version=0.5
116 | export softcenter_installing_md5=a9148835ab402d8f1ba920aea40011a3
117 | export softcenter_installing_tar_url="adm/adm.tar.gz"
118 | dbus save softcenter_installing
119 | 
120 | sh /koolshare/scripts/app_install.sh
121 | 
122 | rlt=`dbus get softcenter_installing_status`
123 | echo "result $rlt"
124 | if [ "$rlt" == "1" ]; then
125 | 	echo "test006 failed"
126 | 	exit
127 | fi
128 | 


--------------------------------------------------------------------------------
/softcenter/tests/test_app_one.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | #dbus set softcenter_home_url="https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui"
 4 | #dbus set softcenter_home_url="https://raw.githubusercontent.com/koolshare/koolshare.github.io/acelan_softcenter_ui"
 5 | dbus set softcenter_home_url="http://koolshare.ngrok.wang:5000"
 6 | 
 7 | 
 8 | #test001, normal installing
 9 | #dbus remove adm_version
10 | #dbus remove adm_md5
11 | 
12 | #export softcenter_installing_module
13 | #export softcenter_installing_tick
14 | export softcenter_installing_todo=adm
15 | export softcenter_installing_version=0.5
16 | export softcenter_installing_md5=153ca93835ad7ac6a8fecd55f5b9bac5
17 | export softcenter_installing_tar_url="adm/adm.tar.gz"
18 | dbus save softcenter_installing
19 | 
20 | sh /koolshare/scripts/ks_app_install.sh
21 | 
22 | rlt=`dbus get softcenter_installing_status`
23 | if [ "$rlt" != "1" ]; then
24 | 	echo "test001 failed"
25 | 	exit
26 | fi
27 | 


--------------------------------------------------------------------------------
/softcenter/tests/test_app_remove.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | 
3 | dbus set softcenter_home_url="http://koolshare.ngrok.wang:5000"
4 | dbus set softcenter_installing_todo=adm
5 | 
6 | sh /koolshare/scripts/app_remove.sh
7 | 


--------------------------------------------------------------------------------
/softcenter/version:
--------------------------------------------------------------------------------
1 | 1.4.8
2 | 3adbdf1b02b807004413bffd3fe9fe79
3 | 


--------------------------------------------------------------------------------
/speedtest/Changelog.txt:
--------------------------------------------------------------------------------
1 | TODO
2 | 


--------------------------------------------------------------------------------
/speedtest/README.md:
--------------------------------------------------------------------------------
1 | # speedtest_for_xiaobao
2 | 小宝改版固件speedtest插件
3 | 


--------------------------------------------------------------------------------
/speedtest/backup.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | 
 3 | # you can do something here
 4 | # this shell scripts will run at the end of build.py scripts
 5 | 
 6 | tar_name="$1.tar.gz"
 7 | 
 8 | mkdir -p history
 9 | if [ ! -f ./history/version ];then
10 | 	touch ./history/version
11 | fi
12 | 
13 | version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
14 | version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
15 | md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
16 | md5_new=` md5sum $tar_name | awk '{print $1}'`
17 | 
18 | if [ -f ./$tar_name ];then
19 | 	if [ "$version_old" != "$version_new" ];then
20 | 		mkdir ./history/$version_new/
21 | 		cp ./$tar_name ./history/$version_new/
22 | 		echo $version_new $md5_new >> ./history/version
23 | 	fi
24 | fi


--------------------------------------------------------------------------------
/speedtest/build.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | 
 4 | MODULE=speedtest
 5 | VERSION=0.2.2
 6 | TITLE=网络测速
 7 | DESCRIPTION=让测速更简单
 8 | HOME_URL=Module_speedtest.asp
 9 | 
10 | # Check and include base
11 | DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )"
12 | 
13 | # now include build_base.sh
14 | . $DIR/../softcenter/build_base.sh
15 | 
16 | # change to module directory
17 | cd $DIR
18 | 
19 | # do something here
20 | do_build_result
21 | 
22 | # now backup
23 | sh backup.sh $MODULE
24 | 


--------------------------------------------------------------------------------
/speedtest/config.json.js:
--------------------------------------------------------------------------------
1 | {
2 | "version":"0.2.2",
3 | "md5":"058291eb64c151a7f6201ecf476fae28",
4 | "home_url":"Module_speedtest.asp",
5 | "title":"网络测速",
6 | "description":"让测速更简单",
7 | "build_date":"2017-09-11_00:03:48"
8 | }
9 | 


--------------------------------------------------------------------------------
/speedtest/history/0.2.2/speedtest.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/speedtest/history/0.2.2/speedtest.tar.gz


--------------------------------------------------------------------------------
/speedtest/history/version:
--------------------------------------------------------------------------------
1 | 0.2.2 058291eb64c151a7f6201ecf476fae28
2 | 


--------------------------------------------------------------------------------
/speedtest/speedtest.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/speedtest/speedtest.tar.gz


--------------------------------------------------------------------------------
/speedtest/speedtest/bin/speedtest:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/speedtest/speedtest/bin/speedtest


--------------------------------------------------------------------------------
/speedtest/speedtest/install.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | cd /tmp
 3 | cp -rf /tmp/speedtest/scripts/speedtest_config.sh /koolshare/scripts/
 4 | cp -rf /tmp/speedtest/bin/speedtest /koolshare/bin/
 5 | cp -rf /tmp/speedtest/webs/Module_speedtest.asp /koolshare/webs/
 6 | rm -rf /tmp/speedtest* >/dev/null 2>&1
 7 | 
 8 | chmod a+x /koolshare/scripts/*.sh
 9 | chmod a+x /koolshare/bin/speedtest
10 | 


--------------------------------------------------------------------------------
/speedtest/speedtest/res/icon-speedtest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/speedtest/speedtest/res/icon-speedtest.png


--------------------------------------------------------------------------------
/speedtest/speedtest/scripts/speedtest_config.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | eval `dbus export speedtest`
 3 | source /koolshare/scripts/base.sh
 4 | version="0.2.2"
 5 | dbus set speedtest_version=$version
 6 | 
 7 | #定义更新相关地址
 8 | UPDATE_VERSION_URL="https://raw.githubusercontent.com/koolshare/koolshare.github.io/master/speedtest/version"
 9 | UPDATE_TAR_URL="https://raw.githubusercontent.com/koolshare/koolshare.github.io/master/speedtest/speedtest.tar.gz"
10 | 
11 | #检查版本
12 | check_version(){
13 | 	speedtest_version_web1=$(curl -s $UPDATE_VERSION_URL | sed -n 1p)
14 | 
15 | 	if [ ! -z $speedtest_version_web1 ];then
16 | 		dbus set speedtest_version_web=$speedtest_version_web1
17 | 	fi
18 | }
19 | 
20 | 
21 | ##测速主逻辑开始
22 | 
23 | #检查是否在运行
24 | speedtest_is_run=$(ps | grep "/koolshare/bin/speedtest" | grep -v grep)
25 | 
26 | #判断测速是否正在进行,确保只有一个测速进程
27 | if [ ! -z "$speedtest_is_run" ]; then
28 | 	exit 0
29 | fi
30 | 
31 | #定义测速变量(1、正在测速;0、测速完成)
32 | dbus set speedtest_status=1
33 | dbus ram speedtest_download=0
34 | dbus ram speedtest_upload=0
35 | 
36 | check_version
37 | 
38 | #定义测速脚本
39 | SPEEDTEST_CLI=`/koolshare/bin/speedtest 1 2 1 2 2>/dev/null`
40 | 
41 | echo "$SPEEDTEST_CLI" | while
42 | #/koolshare/bin/speedtest 1 2 1 2 2>/dev/null | while
43 | read line
44 | do
45 | 	download=$(echo $line | awk -F 'Download = ' '{print $2}' | grep -oE "[0-9]{1,5}[\.][0-9]{1,2}" | head -n 1)
46 | 	upload=$(echo $line | awk -F 'Upload = ' '{print $2}' | grep -oE "[0-9]{1,5}[\.][0-9]{1,2}" | head -n 1)
47 | 	if [[ ! -z $download ]]; then
48 | 		#echo "download : "$download
49 | 		dbus ram speedtest_download=$download
50 | 	fi
51 | 	if [[ ! -z $upload ]]; then
52 | 		#echo "upload : "$upload
53 | 		dbus ram speedtest_upload=$upload
54 | 	fi
55 | done;
56 | 
57 | #完成测速
58 | dbus set speedtest_status=0
59 | 


--------------------------------------------------------------------------------
/speedtest/speedtest/scripts/speedtest_uninstall.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | 
3 | rm -f /koolshare/scripts/speedtest.sh
4 | rm -f /koolshare/bin/speedtest
5 | rm -f /koolshare/webs/Module_speedtest.asp
6 | 


--------------------------------------------------------------------------------
/speedtest/version:
--------------------------------------------------------------------------------
1 | 0.2.2
2 | 058291eb64c151a7f6201ecf476fae28
3 | 


--------------------------------------------------------------------------------
/ssid/backup.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | 
 3 | # you can do something here
 4 | # this shell scripts will run at the end of build.py scripts
 5 | 
 6 | tar_name="$1.tar.gz"
 7 | 
 8 | mkdir -p history
 9 | if [ ! -f ./history/version ];then
10 | 	touch ./history/version
11 | fi
12 | 
13 | version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
14 | version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
15 | md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
16 | md5_new=` md5sum $tar_name | awk '{print $1}'`
17 | 
18 | if [ -f ./$tar_name ];then
19 | 	if [ "$version_old" != "$version_new" ];then
20 | 		mkdir ./history/$version_new/
21 | 		cp ./$tar_name ./history/$version_new/
22 | 		echo $version_new $md5_new >> ./history/version
23 | 	fi
24 | fi


--------------------------------------------------------------------------------
/ssid/build.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | 
 4 | MODULE=ssid
 5 | VERSION=1.3
 6 | TITLE=中文SSID
 7 | DESCRIPTION=中文SSID,装逼利器!
 8 | HOME_URL=Module_ssid.asp
 9 | 
10 | # Check and include base
11 | DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )"
12 | 
13 | # now include build_base.sh
14 | . $DIR/../softcenter/build_base.sh
15 | 
16 | # change to module directory
17 | cd $DIR
18 | 
19 | # do something here
20 | do_build_result
21 | 
22 | # now backup
23 | sh backup.sh $MODULE
24 | 


--------------------------------------------------------------------------------
/ssid/config.json.js:
--------------------------------------------------------------------------------
1 | {
2 | "version":"1.3",
3 | "md5":"a5a0d0b75228af999c23eb219fb9aaa9",
4 | "home_url":"Module_ssid.asp",
5 | "title":"中文SSID",
6 | "description":"中文SSID,装逼利器!",
7 | "build_date":"2017-09-11_00:04:13"
8 | }
9 | 


--------------------------------------------------------------------------------
/ssid/history/1.3/ssid.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/ssid/history/1.3/ssid.tar.gz


--------------------------------------------------------------------------------
/ssid/history/version:
--------------------------------------------------------------------------------
1 | 1.3 a5a0d0b75228af999c23eb219fb9aaa9
2 | 


--------------------------------------------------------------------------------
/ssid/ssid.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/ssid/ssid.tar.gz


--------------------------------------------------------------------------------
/ssid/ssid/init.d/S92ssid.sh:
--------------------------------------------------------------------------------
1 | /koolshare/ssid/ssid.sh


--------------------------------------------------------------------------------
/ssid/ssid/install.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | cd /tmp
 3 | cp -rf /tmp/ssid/ssid /koolshare/
 4 | cp -rf /tmp/ssid/scripts/* /koolshare/scripts/
 5 | cp -rf /tmp/ssid/webs/* /koolshare/webs/
 6 | cp -rf /tmp/ssid/res/* /koolshare/res/
 7 | cp -rf /tmp/ssid/init.d/* /koolshare/init.d/
 8 | cd /
 9 | rm -rf /tmp/ssid* >/dev/null 2>&1
10 | 
11 | 
12 | chmod 755 /koolshare/ssid/*
13 | chmod 755 /koolshare/scripts/ssid*
14 | chmod 755 /koolshare/init.d/ssid*
15 | 
16 | 


--------------------------------------------------------------------------------
/ssid/ssid/res/icon-ssid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/ssid/ssid/res/icon-ssid.png


--------------------------------------------------------------------------------
/ssid/ssid/scripts/.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/ssid/ssid/scripts/.tar.gz


--------------------------------------------------------------------------------
/ssid/ssid/scripts/ssid_config.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 | 
3 | sh /koolshare/ssid/ssid.sh start
4 | 


--------------------------------------------------------------------------------
/ssid/ssid/scripts/ssid_uninstall.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | 
3 | 
4 | rm -rf /koolshare/ssid
5 | rm -rf /init.d/S92ssid.sh
6 | rm -rf /scripts/ssid_*.sh
7 | rm -rf /webs/Module_ssid.asp
8 | 
9 | 


--------------------------------------------------------------------------------
/ssid/ssid/ssid/ssid.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | # ====================================变量定义====================================
 3 | # 版本号定义
 4 | version="1.3"
 5 | dbus set ssid_version="$version"
 6 | # 导入skipd数据
 7 | eval `dbus export ssid`
 8 | 
 9 | # 引用环境变量等
10 | source /koolshare/scripts/base.sh
11 | 
12 | ssid_24_origin=`nvram get wl0_ssid`
13 | ssid_50_origin=`nvram get wl1_ssid`
14 | 
15 | set_ssid(){
16 | 	if [ "$ssid_24_origin" != "$ssid_24" ] || [ "$ssid_50_origin" != "$ssid_50" ] && [ ! -z "$ssid_24" ] && [ ! -z "$ssid_50" ];then
17 | 		# set 2.4G wireless ssid
18 | 		nvram set wl0_ssid="$ssid_24"
19 | 		
20 | 		# set 5G wireless ssid
21 | 		nvram set wl1_ssid="$ssid_50"
22 | 		
23 | 		# restart wifi
24 | 		service restart_wireless
25 | 	fi
26 | }
27 | 
28 | case $ACTION in
29 | start)
30 | 	set_ssid
31 | 	;;
32 | esac
33 | 


--------------------------------------------------------------------------------
/ssid/version:
--------------------------------------------------------------------------------
1 | 1.3
2 | a5a0d0b75228af999c23eb219fb9aaa9
3 | 


--------------------------------------------------------------------------------
/swap/backup.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | 
 3 | # you can do something here
 4 | # this shell scripts will run at the end of build.py scripts
 5 | 
 6 | tar_name="$1.tar.gz"
 7 | 
 8 | mkdir -p history
 9 | if [ ! -f ./history/version ];then
10 | 	touch ./history/version
11 | fi
12 | 
13 | version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p`
14 | version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4`
15 | md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p`
16 | md5_new=` md5sum $tar_name | awk '{print $1}'`
17 | 
18 | if [ -f ./$tar_name ];then
19 | 	if [ "$version_old" != "$version_new" ];then
20 | 		mkdir ./history/$version_new/
21 | 		cp ./$tar_name ./history/$version_new/
22 | 		echo $version_new $md5_new >> ./history/version
23 | 	fi
24 | fi


--------------------------------------------------------------------------------
/swap/build.sh:
--------------------------------------------------------------------------------
 1 | #!/bin/sh
 2 | 
 3 | 
 4 | MODULE=swap
 5 | VERSION=2.2
 6 | TITLE=虚拟内存
 7 | DESCRIPTION=老板,来一斤虚拟内存~
 8 | HOME_URL=Module_swap.asp
 9 | 
10 | # Check and include base
11 | DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )"
12 | 
13 | # now include build_base.sh
14 | . $DIR/../softcenter/build_base.sh
15 | 
16 | # change to module directory
17 | cd $DIR
18 | 
19 | # do something here
20 | do_build_result
21 | 
22 | # now backup
23 | sh backup.sh $MODULE
24 | 


--------------------------------------------------------------------------------
/swap/config.json.js:
--------------------------------------------------------------------------------
1 | {
2 | "version":"2.2",
3 | "md5":"e817df4de63de61ac948928dd5db53a8",
4 | "home_url":"Module_swap.asp",
5 | "title":"虚拟内存",
6 | "description":"老板,来一斤虚拟内存~",
7 | "build_date":"2017-09-11_00:04:49"
8 | }
9 | 


--------------------------------------------------------------------------------
/swap/history/2.2/swap.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/swap/history/2.2/swap.tar.gz


--------------------------------------------------------------------------------
/swap/history/version:
--------------------------------------------------------------------------------
1 | 2.2 e817df4de63de61ac948928dd5db53a8
2 | 


--------------------------------------------------------------------------------
/swap/swap.tar.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/swap/swap.tar.gz


--------------------------------------------------------------------------------
/swap/swap/install.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | cd /tmp
 3 | cp -rf /tmp/swap/swap /koolshare/
 4 | cp -rf /tmp/swap/scripts/* /koolshare/scripts/
 5 | cp -rf /tmp/swap/webs/* /koolshare/webs/
 6 | cp -rf /tmp/swap/res/* /koolshare/res/
 7 | cd /
 8 | rm -rf /tmp/swap* >/dev/null 2>&1
 9 | 
10 | 
11 | chmod 755 /koolshare/swap/*
12 | chmod 755 /koolshare/scripts/swap*
13 | 
14 | 


--------------------------------------------------------------------------------
/swap/swap/res/icon-swap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/koolshare/koolshare.github.io/8eb8ea76146bb83791e141ceb2e205f016ffcaff/swap/swap/res/icon-swap.png


--------------------------------------------------------------------------------
/swap/swap/scripts/swap_check.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 | 
3 | sh /koolshare/swap/swap.sh check
4 | 


--------------------------------------------------------------------------------
/swap/swap/scripts/swap_load.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 | 
3 | sh /koolshare/swap/swap.sh load
4 | 


--------------------------------------------------------------------------------
/swap/swap/scripts/swap_startup.sh:
--------------------------------------------------------------------------------
 1 | #! /bin/sh
 2 | # ====================================变量定义====================================
 3 | eval `dbus export swap`
 4 | 
 5 | usb_disk=`/bin/mount | grep -E 'mnt' | sed -n 1p | cut -d" " -f3`
 6 | 
 7 | sleep 2
 8 | if [ -f $usb_disk/swapfile ]
 9 | then
10 |   echo -e "Mounting swap file..."
11 |   swapon $usb_disk/swapswapfile
12 | else
13 |   echo -e "Swap file not found or $usb_disk is not mounted..."
14 | fi


--------------------------------------------------------------------------------
/swap/swap/scripts/swap_unload.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 | 
3 | sh /koolshare/swap/swap.sh unload


--------------------------------------------------------------------------------
/swap/swap/swap/swap.sh:
--------------------------------------------------------------------------------
  1 | #! /bin/sh
  2 | # ====================================变量定义====================================
  3 | # 版本号定义
  4 | version="1.8"
  5 | dbus set swap_version="$version"
  6 | # 导入skipd数据
  7 | eval `dbus export swap`
  8 | 
  9 | # 引用环境变量等
 10 | source /koolshare/scripts/base.sh
 11 | 
 12 | check_usb_status(){
 13 | 	
 14 | 	# 1	没有找到可用的USB磁盘
 15 | 	# 2	USB磁盘格式不符合要求
 16 | 	# 3	成功检测到ext?格式磁盘,可以创建swap
 17 | 	# 4	swap分区已经加载
 18 | 
 19 | 	ext_type=`/bin/mount | grep -E 'mnt' | cut -d" " -f5 | grep -Eo "ext2|ext3|ext4"`
 20 | 	usb_disk=`/bin/mount | grep -E 'mnt' | sed -n 1p | cut -d" " -f3`
 21 | 	swapon=`free | grep Swap | awk '{print $2}'`
 22 | 	dbus set swap_usb_type="$ext_type"
 23 | 	dbus set swap_usb_disk="$usb_disk"
 24 | 	
 25 | if [ "$swapon" == "0" ];then
 26 | 	if [ -z "$usb_disk" ];then
 27 | 		dbus set swap_warnning="1"
 28 | 	else
 29 | 		if [ -f "$usb_disk"/swapfile ];then
 30 | 			swapon "$usb_disk"/swapfile
 31 | 			dbus set swap_warnning="4"
 32 | 		else
 33 | 			if [ "$ext_type" != "" ];then
 34 | 				dbus set swap_warnning="3"
 35 | 			else
 36 | 				dbus set swap_warnning="2"
 37 | 			fi
 38 | 		fi
 39 | 	fi
 40 | else
 41 | 		dbus set swap_warnning="4"
 42 | fi
 43 | }
 44 | 
 45 | 
 46 | mkswap(){
 47 | 	if [ "$swap_warnning" == "3" ];then
 48 | 		[ "$swap_size" == "1" ] && size=256144
 49 | 		[ "$swap_size" == "2" ] && size=524288
 50 | 		[ "$swap_size" == "3" ] && size=1048576
 51 | 		if [ ! -f  $usb_disk/swap ];then
 52 | 			dd if=/dev/zero of=$usb_disk/swapfile bs=1024 count="$size"
 53 | 			/sbin/mkswap $usb_disk/swapfile
 54 | 			chmod 0600 $usb_disk/swapfile
 55 | 			swapon $usb_disk/swapfile
 56 | 		fi
 57 | 	fi
 58 | }
 59 | 
 60 | swap_load_start(){
 61 | 	if [ -f /jffs/scripts/post-mount ]; then
 62 | 		startswap=$(cat /jffs/scripts/post-mount | grep "swap_load" |wc -l)
 63 | 		if [ "$startswap" != "1" ];then
 64 | 			echo "#! /bin/sh" > /jffs/scripts/post-mount
 65 | 			echo " " >> /jffs/scripts/post-mount
 66 | 			sed -i '$a\sh\ \/koolshare/scripts/swap_load.sh' /jffs/scripts/post-mount
 67 | 		else
 68 | 			echo already set start up for swap load
 69 | 		fi
 70 | 	else
 71 | 		echo "#! /bin/sh" > /jffs/scripts/post-mount
 72 | 		echo " " >> /jffs/scripts/post-mount
 73 | 		sed -i '$a\sh\ \/koolshare/scripts/swap_load.sh' /jffs/scripts/post-mount
 74 | 	fi
 75 | 	chmod +x /jffs/scripts/post-mount
 76 | }
 77 | 
 78 | swap_unload_start(){
 79 | 	sed -i '/swap_load/d' /jffs/scripts/post-mount >/dev/null 2>&1
 80 | }
 81 | 
 82 | case $ACTION in
 83 | start)
 84 | 	check_usb_status
 85 | 	;;
 86 | load)
 87 | 	check_usb_status
 88 | 	mkswap
 89 | 	swap_load_start
 90 | 	;;
 91 | unload)
 92 | 	usb_disk=`/bin/mount | grep -E 'mnt' | sed -n 1p | cut -d" " -f3`
 93 | 	swapoff $usb_disk/swapfile
 94 | 	rm -rf $usb_disk/swapfile
 95 | 	swap_unload_start
 96 | 	;;
 97 | check)
 98 | 	check_usb_status
 99 | 	swap_load_start
100 | 	;;
101 | esac
102 | 
103 | 


--------------------------------------------------------------------------------
/swap/version:
--------------------------------------------------------------------------------
1 | 2.2
2 | e817df4de63de61ac948928dd5db53a8
3 | 


--------------------------------------------------------------------------------