diff --git a/kms/kms/webs/Module_kms.asp b/kms/kms/webs/Module_kms.asp index 600e6cd..f0c3e30 100644 --- a/kms/kms/webs/Module_kms.asp +++ b/kms/kms/webs/Module_kms.asp @@ -65,7 +65,7 @@ function version_show(){ $j.ajax({ - url: 'https://raw.githubusercontent.com/paldier/softcenter_ks/mips_softerware_center/kms/config.json.js', + url: 'https://raw.githubusercontent.com/paldier/softcenter/master/kms/config.json.js', type: 'GET', dataType: 'json', success: function(res) { @@ -147,7 +147,7 @@
当前版本:<% dbus_get_def("kms_ver", "未知"); %>
- [ 更新日志 ] + [ 更新日志 ] diff --git a/softcenter/Changelog.txt b/softcenter/Changelog.txt new file mode 100644 index 0000000..3563a95 --- /dev/null +++ b/softcenter/Changelog.txt @@ -0,0 +1,14 @@ +Koolshare Asuswrt-Merlin softeware center Changelog +=========================================== +1.1.0 + - fix make shadowsocks the first icon in softerware center when using local data + +1.0.9 + - fix fix shadowsocks turn to koolsocks when software center server is down + - add make shadowsocks default installed in softerware center(prepare for the next fw) + +1.0.8 + - fix icon position adjustmet + +1.0.5 + - fix 插件隐藏按钮移动到右侧 diff --git a/softcenter/README.md b/softcenter/README.md new file mode 100644 index 0000000..6bd9fc2 --- /dev/null +++ b/softcenter/README.md @@ -0,0 +1,34 @@ +软件中心原理 +===== +负责维护与独立更新新增模块的安装脚本以及安装界面。也就是说路由器初步只需要安装软件中心,再由软件中心去更新各个模块的安装脚本与安装界面,用户就可以独立安装相应的模块了。恩,这个是一个好想法。 + +目前软件中心没有像 openwrt 一样使用 opkg 来解决软件安装的依赖问题。目前原因是为了简单。所以现在只是一个安装的压缩包,并没有解决软件中心的各大依赖问题。如果有依赖问题请在安装脚本里去实现与提示。 + +模块实现规定 +====== +比如 adm 模块。本项目文件夹形式: +* adm + * adm adm程序本身的一些配置,以及可执行程序 + * bin 相关用到的可执行文件 + * init.d 启动脚本。其实是一个软链接 + * install.sh 模块本身解压之后要运行的安装脚本 + * scripts http 界面配置需要用到的网页配置相关脚本 + * adm_install.sh 软件中心安装包要带上它,以实现模块的安装 + * adm_udpate.sh 软件中心要带上它,以实现模块的更新 + * adm_config.sh 路由器 http server 服务的配置脚本 + * adm_uninstall.sh 卸载 + * webs + * Module_adm.asp 路由器配置界面,软件中心要带上它,以实现模块界面的安装。用户才可以点开配置界面安装模块本身。 + * build.sh 模块生成脚本 + * config.json.js 当前项目在线版本号,通过跨域调用来获得此版本 + * version 版本信息文件,模块安装依赖此版本信息 + +软件中心设计初步想法 +====== +* 所有的图标存于./softcenter/res/software_center.png +* 所有的 APP 信息存于 app.json.js +* 已安装的数据,存于路由器内部 +* 未安装部分,实时从 github 拿到数据 +* 问题 + * 未安装部分的图片,如何实时从github当中拿? + * 未安装部分的 css 如何实时从 github 动态拉取拿? diff --git a/softcenter/app.json.js b/softcenter/app.json.js new file mode 100644 index 0000000..5c607b3 --- /dev/null +++ b/softcenter/app.json.js @@ -0,0 +1,120 @@ +{ + "apps": [ + { + "build_date": "2016-09-01_17:20:58", + "description": "让测速更简单", + "home_url": "Module_speedtest.asp", + "md5": "7adab161925485c41ff8b54a7ffc75f2", + "name": "speedtest", + "tar_url": "speedtest/speedtest.tar.gz", + "title": "网络测速", + "version": "0.2.2" + }, + { + "name": "shadowsocks", + "tar_url": "shadowsocks/shadowsocks.tar.gz", + "title": "shadowsocks" + }, + { + "build_date": "2017-05-03_19:15:58", + "description": "godaddy ddns!", + "home_url": "Module_gdddns.asp", + "md5": "6d1fce64a66aa830df21abf764456def", + "module": "gdddns", + "name": "gdddns", + "tar_url": "gdddns/gdddns.tar.gz", + "title": "gdddns", + "version": "1.0.0" + }, + { + "build_date": "2016-09-01_17:21:04", + "description": "老板,来一斤虚拟内存~", + "home_url": "Module_swap.asp", + "md5": "852a398f732af3508c83a6d3ca91f25d", + "name": "swap", + "tar_url": "swap/swap.tar.gz", + "title": "虚拟内存", + "version": "1.8" + }, + { + "build_date": "2017-06-06_01:02:58", + "description": "koolproxy", + "home_url": "Module_koolproxy.asp", + "md5": "11d29bfc9f80fa76ffe23d834cd7799b", + "name": "koolproxy", + "tar_url": "koolproxy/koolproxy.tar.gz", + "title": "koolproxy", + "version": "3.2.9" + }, + { + "build_date": "2016-09-01_17:20:52", + "description": "迅雷快鸟,为上网加速而生~", + "home_url": "Module_kuainiao.asp", + "md5": "e767c621332ec5cb4227d4358c9a283b", + "name": "kuainiao", + "tar_url": "kuainiao/kuainiao.tar.gz", + "title": "讯雷快鸟", + "version": "0.3.6" + }, + { + "build_date": "2018-12-06_13:29:29", + "description": "kms", + "home_url": "Module_kms.asp", + "md5": "647a16ede1b4cea1615391b6465b1525", + "name": "kms", + "tar_url": "kms/kms.tar.gz", + "title": "kms", + "version": "1.5" + }, + { + "build_date": "2016-09-27_18:43:33", + "description": "阿里云解析自动更新IP", + "home_url": "Module_aliddns.asp", + "md5": "00c97793e5b7195dd1d1def15f506883", + "module": "aliddns", + "name": "aliddns", + "tar_url": "aliddns/aliddns.tar.gz", + "title": "aliddns", + "version": "1.0" + }, + { + "build_date": "2016-09-01_17:20:40", + "description": "使用Dnspod的ddns服务", + "home_url": "Module_ddnspod.asp", + "md5": "85041eb4ae44c853dd61243d2c4f2fda", + "name": "ddnspod", + "tar_url": "ddnspod/ddnspod.tar.gz", + "title": "DDnspod", + "version": "0.1.3" + }, + { + "name": "tunnel", + "tar_url": "tunnel/tunnel.tar.gz", + "title": "tunnel" + }, + { + "build_date": "2016-09-01_17:20:46", + "description": "让分流更简单", + "home_url": "Module_policy_route.asp", + "md5": "3112c34fa479156b5872ae700b7015b3", + "name": "dualwan", + "tar_url": "dualwan/dualwan.tar.gz", + "title": "策略路由", + "version": "0.6" + }, + { + "build_date": "2016-09-16_10:11:21", + "description": "广告屏蔽大师", + "home_url": "Module_adbyby.asp", + "md5": "8822d84a21ec33db53bdb4c1a98b2394", + "name": "adbyby", + "tar_url": "adbyby/adbyby.tar.gz", + "title": "adbyby", + "version": "1.1" + } + ], + "home_url": "https://raw.githubusercontent.com/paldier/softcenter/master", + "md5": "3242715f2a71bec3ffc70252f92c977b", + "tar_url": "softcenter/softcenter.tar.gz", + "version": "1.1.6" +} \ No newline at end of file diff --git a/softcenter/app.template.json.js b/softcenter/app.template.json.js new file mode 100644 index 0000000..a524f76 --- /dev/null +++ b/softcenter/app.template.json.js @@ -0,0 +1,21 @@ +{ + "version":"1.0.5", + "md5":"a16640f5a0df9186897be0de52e6629a", + "tar_url":"softcenter/softcenter.tar.gz", + "home_url":"https://raw.githubusercontent.com/paldier/softcenter/master", + + "apps": +[ +{ + "name":"adm", + "title":"阿呆猫", + "ver":"0.5", + "home_url":"/Module_xunlei.asp", + "tar_url":"adm/adm.tar.gz", + "md5":"31559b347f6c8081ccdece78e50156d5" +}, +{ +} +] + +} diff --git a/softcenter/backup.sh b/softcenter/backup.sh new file mode 100755 index 0000000..ef0e21c --- /dev/null +++ b/softcenter/backup.sh @@ -0,0 +1,25 @@ +#! /bin/sh + +# you can do something here +# this shell scripts will run at the end of build.py scripts + + + +mkdir -p history +if [ ! -f ./history/version ];then + touch ./history/version +fi + +version_old=`cat history/version | awk '{print $1}' | sort -rn |sed -n 1p` +version_new=`cat config.json.js |grep "version"|cut -d"\"" -f 4` +md5_old=`cat history/version | sort -nk1 | awk '{print $1}' |sed -n 1p` +md5_new=` md5sum softcenter.tar.gz | awk '{print $1}'` + +if [ -f ./softcenter.tar.gz ];then + if [ "$version_old" != "$version_new" ];then + mkdir ./history/$version_new/ + cp ./softcenter.tar.gz ./history/$version_new/ + echo $version_new $md5_new >> ./history/version + fi +fi + diff --git a/softcenter/build.sh b/softcenter/build.sh new file mode 100755 index 0000000..a9c45f5 --- /dev/null +++ b/softcenter/build.sh @@ -0,0 +1,30 @@ +#! /bin/sh +VERSION=1.1.6 + +cat version +rm -f softcenter.tar.gz +mkdir -p ./softcenter/res + +python ./gen_install.py stage1 + +chmod 755 ./softcenter/scripts/ks_app_install.sh + +tar -zcvf softcenter.tar.gz softcenter +md5value=`md5sum softcenter.tar.gz|tr " " "\n"|sed -n 1p` +cat > ./version < ./config.json.js < ./version < ./config.json.js < ./version < ./config.json.js < 1: + stage = sys.argv[1] + +curr_path = os.path.dirname(os.path.realpath(__file__)) +parent_path = os.path.realpath(os.path.join(curr_path, "..")) + +to_remove = None + +def md5sum(full_path): + with open(full_path, 'rb') as rf: + return hashlib.md5(rf.read()).hexdigest() + +def work_paths_by_walk(): + index = 0 + for root,subdirs,files in os.walk(parent_path): + index += 1 + for filepath in files: + print os.path.join(root,filepath) + for sub in subdirs: + print os.path.join(root,sub) + +def work_parent(): + ignore_paths = frozenset(["maintain_files", "softcenter", "v2ray"]) + for fname in os.listdir(parent_path): + + if fname[0] == "." or fname in ignore_paths: + continue + + path = os.path.join(parent_path, fname) + if os.path.isdir(path): + #print fname + #print path + yield fname, path + +def work_files(parent, ext): + for fname in os.listdir(parent): + path = os.path.join(parent, fname) + if os.path.isfile(path): + yield path + +def check_subdir(module, path, name, ext, target_path): + script_path = os.path.join(path, module, name) + if os.path.isdir(script_path): + for f in work_files(script_path, ext): + target_file = os.path.join(target_path, os.path.basename(f)) + #print "copy", f, "-->", target_file + copyfile(f, target_file) + if not target_file.endswith(".png") and to_remove: + to_remove.write(target_file+"\n") + +def check_and_cp(): + for module, path in work_parent(): + #check_subdir(module, path, "scripts", ".sh", os.path.join(curr_path, "softcenter", "scripts")) + #check_subdir(module, path, "webs", ".asp", os.path.join(curr_path, "softcenter", "webs")) + #check_subdir(module, path, "scripts", ".sh", os.path.join(curr_path, "softcenter", "scripts")) + check_subdir(module, path, "res", "*", os.path.join(curr_path, "softcenter", "res")) + +def gen_modules(modules): + for module, path in work_parent(): + conf = os.path.join(path, "config.json.js") + + m = None + try: + with codecs.open(conf, "r", "utf-8") as fc: + m = json.loads(fc.read()) + if m: + m["name"] = module + if "tar_url" not in m: + m["tar_url"] = module + "/" + module + ".tar.gz" + if "home_url" not in m: + m["home_url"] = "Module_" + module + ".asp" + except: + pass + + if not m: + m = {"name":module, "title":module, "tar_url": module + "/" + module + ".tar.gz"} + modules.append(m) + +if stage == "stage1": + to_remove = open(os.path.join(curr_path, "to_remove.txt"), "w") + check_and_cp() + to_remove.close() +else: + gmodules = None + with codecs.open(os.path.join(curr_path, "app.template.json.js"), "r", "utf-8") as fg: + gmodules = json.loads(fg.read()) + gmodules["apps"] = [] + gen_modules(gmodules["apps"]) + + with codecs.open(os.path.join(curr_path, "config.json.js"), "r", "utf-8") as fc: + conf = json.loads(fc.read()) + gmodules["version"] = conf["version"] + gmodules["md5"] = conf["md5"] + + with codecs.open(os.path.join(curr_path, "app.json.js"), "w", "utf-8") as fw: + json.dump(gmodules, fw, sort_keys = True, indent = 4, ensure_ascii=False, encoding='utf8') diff --git a/softcenter/history/1.1.5/softcenter.tar.gz b/softcenter/history/1.1.5/softcenter.tar.gz new file mode 100644 index 0000000..47c3eab Binary files /dev/null and b/softcenter/history/1.1.5/softcenter.tar.gz differ diff --git a/softcenter/history/1.1.6/softcenter.tar.gz b/softcenter/history/1.1.6/softcenter.tar.gz new file mode 100644 index 0000000..6951c23 Binary files /dev/null and b/softcenter/history/1.1.6/softcenter.tar.gz differ diff --git a/softcenter/history/version b/softcenter/history/version new file mode 100644 index 0000000..9e8bdac --- /dev/null +++ b/softcenter/history/version @@ -0,0 +1,2 @@ +1.1.5 78c52468f168d06a87b17462cbcce395 +1.1.6 3242715f2a71bec3ffc70252f92c977b diff --git a/softcenter/index.html b/softcenter/index.html new file mode 100644 index 0000000..6c4497f --- /dev/null +++ b/softcenter/index.html @@ -0,0 +1,6 @@ + + +

Hello to softcenter home page

+ + + diff --git a/softcenter/push_message.json.js b/softcenter/push_message.json.js new file mode 100644 index 0000000..27d6e19 --- /dev/null +++ b/softcenter/push_message.json.js @@ -0,0 +1,7 @@ +{ +"title":"梅林改版固件 - 软件中心", +"content1":"软件中心测试版:(2018年12月6日):", +"content2":"原软件中心暂时按原来方式运行;", +"content3":"新软件中心内不要启用和原软件中心冲突的插件", +"content4":"祝好!" +} diff --git a/softcenter/softcenter.tar.gz b/softcenter/softcenter.tar.gz new file mode 100644 index 0000000..6951c23 Binary files /dev/null and b/softcenter/softcenter.tar.gz differ diff --git a/softcenter/softcenter/bin/perp-setup b/softcenter/softcenter/bin/perp-setup new file mode 100644 index 0000000..a0dce8a --- /dev/null +++ b/softcenter/softcenter/bin/perp-setup @@ -0,0 +1,227 @@ +#!/bin/sh -e +# perp: persistent process supervision +# perp-setup: one-time, post-install configurator for perp +# wcm, 2009.12.23 - 2012.01.04 +# === +## basename: +_PROG=${0##*/} +_PID=$$ + +_BASE_DEFAULT=/etc/perp +_CTL_DEFAULT=/var/run/perp + +_BASE=${PERP_BASE:-${_BASE_DEFAULT}} +_CTL=${PERP_CTL:-${_CTL_DEFAULT}} + +_INITTAB=/etc/inittab +_RCLOCAL=/etc/rc.local + +_mesg() { + echo "${_PROG}(${_PID}): $1" >/dev/stderr +} + +_fail() { + _mesg "failure: $1" + exit 1 +} + +_done() { + _mesg "perp configured." + exit 0 +} + +## command-line override for _BASE, _CTL: +if test $# -gt 0 ; then + _BASE=${1:-${_BASE}} +fi +if test $# -gt 1 ; then + _CTL=${2:-${_CTL}} +fi + +if test 'X' != ${DESTDIR}'X' ; then + _mesg "configuring perp in DESTDIR ${DESTDIR} for ${_BASE} ..." +else + _mesg "configuring perp for ${DESTDIR}${_BASE} ..." +fi + +if ! test -d ${DESTDIR}${_BASE} ; then + mkdir -p ${DESTDIR}${_BASE} || _fail "unable to create base directory" +fi + +if ! test -d ${DESTDIR}${_BASE}/.boot ; then + mkdir -p ${DESTDIR}${_BASE}/.boot || _fail "unable to create .boot directory" +fi + +if ! test -e ${DESTDIR}${_BASE}/.control -o -L ${DESTDIR}${_BASE}/.control ; then + ## create symlink to control directory (possibly dangling): + ln -s ${_CTL} ${DESTDIR}${_BASE}/.control || \ + _fail "unable to create symlink for .control directory" +fi + +_mesg "configuring perpboot directory in ${DESTDIR}${_BASE}/.boot ..." + +## clean any pre-existing *.new files: +for f in rc.log rc.perp rlimit.conf ; do + rm -f ${DESTDIR}${_BASE}/.boot/${f}.new +done + +## rlimit.conf: +cat - > ${DESTDIR}${_BASE}/.boot/rlimit.conf.new << "%%" +# rlimit.conf +# runlimit setup for perpd +# === +## set RLIMIT_NOFILE and RLIMIT_NPROC to hard limit: +RLIMIT_NOFILE=^ +RLIMIT_NPROC=^ +### EOF +%% + +## rc.perp: +cat - > ${DESTDIR}${_BASE}/.boot/rc.perp.new << "%%" +#!/bin/sh -e +# rc.perp: perpd startup script for perpboot +# === + +### --- configure --- +PERPD_OPTS="-a6" + +### --- script --- + +## exec perpd: +## * options as configured above +## * runchoom(8) abate linux oom-killer +## * runlimit(8) configured in ./rlimit.conf +## * PERP_BASE defined in environment by perpboot(8) +exec \ + runchoom \ + runlimit -F ./rlimit.conf \ + perpd ${PERPD_OPTS} ${PERP_BASE} + +### EOF +%% + +## rc.log: +cat - > ${DESTDIR}${_BASE}/.boot/rc.log.new << "%%" +#!/bin/sh +# rc.log: perpd logger script for perpboot +# === + +### --- configure --- + +## required: +LOGDIR=/var/log/perpd +LOGOPTS="-k 8 -s 100000 -t -z" +## suggested: +LOGUSER=tinylog + +### --- script --- + +## initialize user: +if id ${LOGUSER} >/dev/null 2>/dev/null ; then + my_uid=$(id -u ${LOGUSER}) + my_gid=$(id -g ${LOGUSER}) +else + LOGUSER=$(id -un) + my_uid=$(id -u ${LOGUSER}) + my_gid=$(id -g ${LOGUSER}) +fi + +## initialize logdir: +if ! test -d ${LOGDIR} ; then + mkdir -p ${LOGDIR} +fi +chown -R ${my_uid}:${my_gid} ${LOGDIR} +chmod 0755 ${LOGDIR} + +## exec tinylog with privilege drop: +exec \ + runuid ${LOGUSER} \ + tinylog ${LOGOPTS} ${LOGDIR} + +### EOF +%% + +for f in rlimit.conf ; do + if ! test -f ${DESTDIR}${_BASE}/.boot/${f} ; then + mv ${DESTDIR}${_BASE}/.boot/${f}.new ${DESTDIR}${_BASE}/.boot/${f} + chmod 0644 ${DESTDIR}${_BASE}/.boot/${f} + fi +done + +for f in rc.perp rc.log ; do + if ! test -f ${DESTDIR}${_BASE}/.boot/${f} ; then + mv ${DESTDIR}${_BASE}/.boot/${f}.new ${DESTDIR}${_BASE}/.boot/${f} + chmod 0755 ${DESTDIR}${_BASE}/.boot/${f} + fi +done + +_mesg "perpboot directory configured" + + +## skip init configuration? +if test 'X' != ${DESTDIR}'X' ; then + _mesg "DESTDIR defined, skipping startup configuration" + _done +fi +if test 'X' != ${NO_INIT}'X' ; then + _mesg "NO_INIT defined, skipping startup configuration" + _done +fi + + +## /etc/inittab installation (sysv): +if test -f ${_INITTAB} ; then + _mesg "configuring perpboot entry for ${_INITTAB} ..." + if fgrep perpboot ${_INITTAB} >/dev/null 2>/dev/null ; then + _mesg "perpboot entry already found in ${_INITTAB}" + _done + else + rm -f ${_INITTAB}.new + cat ${_INITTAB} - > ${_INITTAB}.new << %% + +## perp: +PB:12345:respawn:/tmp/p/sbin/perpboot -x ${_BASE} + +### EOF +%% + mv ${_INITTAB}.new ${_INITTAB} + _mesg "perpboot entry added to ${_INITTAB}" + _mesg "*** please run \"kill -HUP 1\" to activate ***" + # kill -HUP 1 + _done + fi +fi + +## /etc/rc.local installation (bsd): +if test -f ${_RCLOCAL} ; then + _mesg "configuring perpboot entry for ${_RCLOCAL} ..." + if fgrep perpboot ${_RCLOCAL} >/dev/null 2>/dev/null ; then + _mesg "perpboot entry already found in ${_RCLOCAL}" + _done + else + rm -f ${_RCLOCAL}.new + cat ${_RCLOCAL} - > ${_RCLOCAL}.new << %% + +## perp: +if [ -x /tmp/p/sbin/perpboot ]; then + echo -n ' perpd' + ## to modify path within perp runscripts, edit/uncomment: + #PATH=/sbin:/bin:/usr/sbin:/usr/bin \\ + /tmp/p/sbin/perpboot -d ${_BASE} +fi + +### EOF +%% + mv ${_RCLOCAL}.new ${_RCLOCAL} + _mesg "perpboot entry added to ${_RCLOCAL}" + _mesg "*** please restart system to activate ***" + _done + fi +fi + + +_mesg "uh oh, neither ${_INITTAB} nor ${_RCLOCAL} were found on your system!" +_mesg "this system will require manual startup configuration for perpd(8)/perpboot(8)" +exit 1 + +### EOF diff --git a/softcenter/softcenter/bin/perpboot b/softcenter/softcenter/bin/perpboot new file mode 100644 index 0000000..c4a51be Binary files /dev/null and b/softcenter/softcenter/bin/perpboot differ diff --git a/softcenter/softcenter/bin/perpctl b/softcenter/softcenter/bin/perpctl new file mode 100644 index 0000000..89afdfe Binary files /dev/null and b/softcenter/softcenter/bin/perpctl differ diff --git a/softcenter/softcenter/bin/perpd b/softcenter/softcenter/bin/perpd new file mode 100644 index 0000000..00a5768 Binary files /dev/null and b/softcenter/softcenter/bin/perpd differ diff --git a/softcenter/softcenter/bin/perphup b/softcenter/softcenter/bin/perphup new file mode 100644 index 0000000..9304fb2 Binary files /dev/null and b/softcenter/softcenter/bin/perphup differ diff --git a/softcenter/softcenter/bin/perpls b/softcenter/softcenter/bin/perpls new file mode 100644 index 0000000..0682610 Binary files /dev/null and b/softcenter/softcenter/bin/perpls differ diff --git a/softcenter/softcenter/bin/perpok b/softcenter/softcenter/bin/perpok new file mode 100644 index 0000000..54a3fbc Binary files /dev/null and b/softcenter/softcenter/bin/perpok differ diff --git a/softcenter/softcenter/bin/perpstat b/softcenter/softcenter/bin/perpstat new file mode 100644 index 0000000..466e0d0 Binary files /dev/null and b/softcenter/softcenter/bin/perpstat differ diff --git a/softcenter/softcenter/bin/sissylog b/softcenter/softcenter/bin/sissylog new file mode 100644 index 0000000..8b75fce Binary files /dev/null and b/softcenter/softcenter/bin/sissylog differ diff --git a/softcenter/softcenter/bin/tinylog b/softcenter/softcenter/bin/tinylog new file mode 100644 index 0000000..ab4678e Binary files /dev/null and b/softcenter/softcenter/bin/tinylog differ diff --git a/softcenter/softcenter/install.sh b/softcenter/softcenter/install.sh new file mode 100755 index 0000000..888232b --- /dev/null +++ b/softcenter/softcenter/install.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +softcenter_install() { + if [ -d "/tmp/softcenter" ]; then + cp -rf /tmp/softcenter/webs/* /jffs/softcenter/webs + cp -rf /tmp/softcenter/res/* /jffs/softcenter/res/ + cp -rf /tmp/softcenter/bin/* /jffs/softcenter/bin/ + cp -rf /tmp/softcenter/perp /jffs/softcenter/ + cp -rf /tmp/softcenter/scripts /jffs/softcenter/ + chmod 755 /jffs/softcenter/bin/* + chmod 755 /jffs/softcenter/perp/* + chmod 755 /jffs/softcenter/perp/.boot/* + chmod 755 /jffs/softcenter/perp/.control/* + chmod 755 /jffs/softcenter/perp/adm/* + rm -rf /tmp/softcenter + if [ ! -f "/jffs/softcenter/init.d/S10Softcenter.sh" ]; then + ln -sf /jffs/softcenter/scripts/app_install.sh /jffs/softcenter/init.d/S10Softcenter.sh + fi + fi +} + +softcenter_install diff --git a/softcenter/softcenter/perp/.boot/rc.log b/softcenter/softcenter/perp/.boot/rc.log new file mode 100755 index 0000000..a8fce5b --- /dev/null +++ b/softcenter/softcenter/perp/.boot/rc.log @@ -0,0 +1,3 @@ +#!/bin/sh +LOGDIR=/var/log/perpd +exec tinylog -k 3 -s 50000 -t ${LOGDIR} diff --git a/softcenter/softcenter/perp/.boot/rc.perp b/softcenter/softcenter/perp/.boot/rc.perp new file mode 100755 index 0000000..4098b43 --- /dev/null +++ b/softcenter/softcenter/perp/.boot/rc.perp @@ -0,0 +1,2 @@ +#!/bin/sh +exec perpd -a 6 $PERP_BASE diff --git a/softcenter/softcenter/perp/.control/perpd.pid b/softcenter/softcenter/perp/.control/perpd.pid new file mode 100644 index 0000000..d96ebc2 --- /dev/null +++ b/softcenter/softcenter/perp/.control/perpd.pid @@ -0,0 +1 @@ +30237 diff --git a/softcenter/softcenter/perp/adm/rc.log b/softcenter/softcenter/perp/adm/rc.log new file mode 100755 index 0000000..92dcc08 --- /dev/null +++ b/softcenter/softcenter/perp/adm/rc.log @@ -0,0 +1,6 @@ +#!/bin/sh +if test ${1} = 'start' ; then + exec tinylog -k 5 -t /var/log/${2} +fi + +exit 0 diff --git a/softcenter/softcenter/perp/adm/rc.main b/softcenter/softcenter/perp/adm/rc.main new file mode 100755 index 0000000..fe29c6c --- /dev/null +++ b/softcenter/softcenter/perp/adm/rc.main @@ -0,0 +1,10 @@ +#!/bin/sh +adm_enable=`dbus get adm_enable` +exec 2>&1 +if test ${1} = 'start' ; then + if [ "$adm_enable" == "1" ];then + exec /jffs/softcenter/adm/ADM + fi +fi + +exit 0 diff --git a/softcenter/softcenter/perp/perp.sh b/softcenter/softcenter/perp/perp.sh new file mode 100755 index 0000000..bbd6cde --- /dev/null +++ b/softcenter/softcenter/perp/perp.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +source /jffs/softcenter/scripts/base.sh +export PERP_BASE=/koolshare/perp + +case $ACTION in +start) + if ! pidof perpd > /dev/null; then + perpboot -d + fi + ;; +stop) + if pidof perpd > /dev/null; then + kill -9 `pidof perpboot` + kill -9 `pidof tinylog` + kill -9 `pidof perpd` + fi + ;; +*) + echo "Usage: $0 (start)" + exit 1 + ;; +esac diff --git a/softcenter/softcenter/res/all.png b/softcenter/softcenter/res/all.png new file mode 100644 index 0000000..3eb3e76 Binary files /dev/null and b/softcenter/softcenter/res/all.png differ diff --git a/softcenter/softcenter/res/chn.png b/softcenter/softcenter/res/chn.png new file mode 100644 index 0000000..d5bf68a Binary files /dev/null and b/softcenter/softcenter/res/chn.png differ diff --git a/softcenter/softcenter/res/gfw.png b/softcenter/softcenter/res/gfw.png new file mode 100644 index 0000000..6174f32 Binary files /dev/null and b/softcenter/softcenter/res/gfw.png differ diff --git a/softcenter/softcenter/res/icon-adbyby.png b/softcenter/softcenter/res/icon-adbyby.png new file mode 100644 index 0000000..31e5392 Binary files /dev/null and b/softcenter/softcenter/res/icon-adbyby.png differ diff --git a/softcenter/softcenter/res/icon-adm.png b/softcenter/softcenter/res/icon-adm.png new file mode 100644 index 0000000..fcef026 Binary files /dev/null and b/softcenter/softcenter/res/icon-adm.png differ diff --git a/softcenter/softcenter/res/icon-aliddns.png b/softcenter/softcenter/res/icon-aliddns.png new file mode 100644 index 0000000..5af96b8 Binary files /dev/null and b/softcenter/softcenter/res/icon-aliddns.png differ diff --git a/softcenter/softcenter/res/icon-appledns.png b/softcenter/softcenter/res/icon-appledns.png new file mode 100644 index 0000000..9e9c3ca Binary files /dev/null and b/softcenter/softcenter/res/icon-appledns.png differ diff --git a/softcenter/softcenter/res/icon-aria2.png b/softcenter/softcenter/res/icon-aria2.png new file mode 100644 index 0000000..74a94c0 Binary files /dev/null and b/softcenter/softcenter/res/icon-aria2.png differ diff --git a/softcenter/softcenter/res/icon-ddnspod.png b/softcenter/softcenter/res/icon-ddnspod.png new file mode 100644 index 0000000..9757623 Binary files /dev/null and b/softcenter/softcenter/res/icon-ddnspod.png differ diff --git a/softcenter/softcenter/res/icon-default.png b/softcenter/softcenter/res/icon-default.png new file mode 100644 index 0000000..f752f29 Binary files /dev/null and b/softcenter/softcenter/res/icon-default.png differ diff --git a/softcenter/softcenter/res/icon-dualwan.png b/softcenter/softcenter/res/icon-dualwan.png new file mode 100644 index 0000000..3c6c00d Binary files /dev/null and b/softcenter/softcenter/res/icon-dualwan.png differ diff --git a/softcenter/softcenter/res/icon-entware.png b/softcenter/softcenter/res/icon-entware.png new file mode 100644 index 0000000..8072eae Binary files /dev/null and b/softcenter/softcenter/res/icon-entware.png differ diff --git a/softcenter/softcenter/res/icon-gdddns.png b/softcenter/softcenter/res/icon-gdddns.png new file mode 100644 index 0000000..9ecd5c8 Binary files /dev/null and b/softcenter/softcenter/res/icon-gdddns.png differ diff --git a/softcenter/softcenter/res/icon-kcptun.png b/softcenter/softcenter/res/icon-kcptun.png new file mode 100644 index 0000000..d4616ba Binary files /dev/null and b/softcenter/softcenter/res/icon-kcptun.png differ diff --git a/softcenter/softcenter/res/icon-kms.png b/softcenter/softcenter/res/icon-kms.png new file mode 100644 index 0000000..d971c1f Binary files /dev/null and b/softcenter/softcenter/res/icon-kms.png differ diff --git a/softcenter/softcenter/res/icon-koolnet.png b/softcenter/softcenter/res/icon-koolnet.png new file mode 100644 index 0000000..be4e686 Binary files /dev/null and b/softcenter/softcenter/res/icon-koolnet.png differ diff --git a/softcenter/softcenter/res/icon-koolproxy.png b/softcenter/softcenter/res/icon-koolproxy.png new file mode 100644 index 0000000..18a6bea Binary files /dev/null and b/softcenter/softcenter/res/icon-koolproxy.png differ diff --git a/softcenter/softcenter/res/icon-kuainiao.png b/softcenter/softcenter/res/icon-kuainiao.png new file mode 100644 index 0000000..3d0aa59 Binary files /dev/null and b/softcenter/softcenter/res/icon-kuainiao.png differ diff --git a/softcenter/softcenter/res/icon-phddns.png b/softcenter/softcenter/res/icon-phddns.png new file mode 100644 index 0000000..f706267 Binary files /dev/null and b/softcenter/softcenter/res/icon-phddns.png differ diff --git a/softcenter/softcenter/res/icon-shadowsocks.png b/softcenter/softcenter/res/icon-shadowsocks.png new file mode 100644 index 0000000..f43d837 Binary files /dev/null and b/softcenter/softcenter/res/icon-shadowsocks.png differ diff --git a/softcenter/softcenter/res/icon-shadowvpn.png b/softcenter/softcenter/res/icon-shadowvpn.png new file mode 100644 index 0000000..8ca59e8 Binary files /dev/null and b/softcenter/softcenter/res/icon-shadowvpn.png differ diff --git a/softcenter/softcenter/res/icon-shell.png b/softcenter/softcenter/res/icon-shell.png new file mode 100644 index 0000000..f752f29 Binary files /dev/null and b/softcenter/softcenter/res/icon-shell.png differ diff --git a/softcenter/softcenter/res/icon-speedtest.png b/softcenter/softcenter/res/icon-speedtest.png new file mode 100644 index 0000000..6d45e15 Binary files /dev/null and b/softcenter/softcenter/res/icon-speedtest.png differ diff --git a/softcenter/softcenter/res/icon-ssid.png b/softcenter/softcenter/res/icon-ssid.png new file mode 100644 index 0000000..a471620 Binary files /dev/null and b/softcenter/softcenter/res/icon-ssid.png differ diff --git a/softcenter/softcenter/res/icon-ssserver.png b/softcenter/softcenter/res/icon-ssserver.png new file mode 100644 index 0000000..8903338 Binary files /dev/null and b/softcenter/softcenter/res/icon-ssserver.png differ diff --git a/softcenter/softcenter/res/icon-swap.png b/softcenter/softcenter/res/icon-swap.png new file mode 100644 index 0000000..b1b7936 Binary files /dev/null and b/softcenter/softcenter/res/icon-swap.png differ diff --git a/softcenter/softcenter/res/icon-thunder.png b/softcenter/softcenter/res/icon-thunder.png new file mode 100644 index 0000000..98ee9e2 Binary files /dev/null and b/softcenter/softcenter/res/icon-thunder.png differ diff --git a/softcenter/softcenter/res/icon-transmission.png b/softcenter/softcenter/res/icon-transmission.png new file mode 100644 index 0000000..27b9709 Binary files /dev/null and b/softcenter/softcenter/res/icon-transmission.png differ diff --git a/softcenter/softcenter/res/icon-tunnel.png b/softcenter/softcenter/res/icon-tunnel.png new file mode 100644 index 0000000..7d6e119 Binary files /dev/null and b/softcenter/softcenter/res/icon-tunnel.png differ diff --git a/softcenter/softcenter/res/icon-v2ray.png b/softcenter/softcenter/res/icon-v2ray.png new file mode 100644 index 0000000..9830a78 Binary files /dev/null and b/softcenter/softcenter/res/icon-v2ray.png differ diff --git a/softcenter/softcenter/res/upgrade.png b/softcenter/softcenter/res/upgrade.png new file mode 100644 index 0000000..7cfef82 Binary files /dev/null and b/softcenter/softcenter/res/upgrade.png differ diff --git a/softcenter/softcenter/scripts/ks_app_install.sh b/softcenter/softcenter/scripts/ks_app_install.sh new file mode 100755 index 0000000..1887167 --- /dev/null +++ b/softcenter/softcenter/scripts/ks_app_install.sh @@ -0,0 +1,256 @@ +#!/bin/sh + +#From dbus to local variable +eval `dbus export softcenter_installing_` +source /jffs/softcenter/scripts/base.sh +export PERP_BASE=/jffs/softcenter/perp + +#softcenter_installing_module #正在安装的模块 +#softcenter_installing_todo #希望安装的模块 +#softcenter_installing_tick #上次安装开始的时间 +#softcenter_installing_version #正在安装的版本 +#softcenter_installing_md5 #正在安装的版本的md5值 +#softcenter_installing_tar_url #模块对应的下载地址 + +#softcenter_installing_status= #尚未安装 +#softcenter_installing_status=0 #尚未安装 +#softcenter_installing_status=1 #已安装 +#softcenter_installing_status=2 #将被安装到jffs分区... +#softcenter_installing_status=3 #正在下载中...请耐心等待... +#softcenter_installing_status=4 #正在安装中... +#softcenter_installing_status=5 #安装成功!请5秒后刷新本页面!... +#softcenter_installing_status=6 #卸载中...... +#softcenter_installing_status=7 #卸载成功! +#softcenter_installing_status=8 #没有检测到在线版本号! +#softcenter_installing_status=9 #正在下载更新...... +#softcenter_installing_status=10 #正在安装更新... +#softcenter_installing_status=11 #安装更新成功,5秒后刷新本页! +#softcenter_installing_status=12 #下载文件校验不一致! +#softcenter_installing_status=13 #然而并没有更新! +#softcenter_installing_status=14 #正在检查是否有更新~ +#softcenter_installing_status=15 #检测更新错误! + +softcenter_home_url=`dbus get softcenter_home_url` +CURR_TICK=`date +%s` +BIN_NAME=$(basename "$0") +BIN_NAME="${BIN_NAME%.*}" +if [ "$ACTION" != "" ]; then + BIN_NAME=$ACTION +fi + +VER_SUFFIX=_version +MD5_SUFFIX=_md5 +INSTALL_SUFFIX=_install +UNINSTALL_SUFFIX=_uninstall + +LOGGER() { +# echo $1 + logger $1 +} + +install_module() { + if [ "$softcenter_home_url" = "" -o "$softcenter_installing_md5" = "" -o "$softcenter_installing_version" = "" ]; then + LOGGER "input error, something not found" + exit 1 + fi + + if [ "$softcenter_installing_tick" = "" ]; then + export softcenter_installing_tick=0 + fi + LAST_TICK=`expr $softcenter_installing_tick + 20` + if [ "$LAST_TICK" -ge "$CURR_TICK" -a "$softcenter_installing_module" != "" ]; then + LOGGER "module $softcenter_installing_module is installing" + exit 2 + fi + + if [ "$softcenter_installing_todo" = "" ]; then + #curr module name not found + LOGGER "module name not found" + exit 3 + fi + + # Just ignore the old installing_module + export softcenter_installing_module=$softcenter_installing_todo + export softcenter_installing_tick=`date +%s` + export softcenter_installing_status="2" + dbus save softcenter_installing_ + + URL_SPLIT="/" + #OLD_MD5=`dbus get softcenter_module_$softcenter_installing_module$MD5_SUFFIX` + OLD_VERSION=`dbus get softcenter_module_$softcenter_installing_module$VER_SUFFIX` + HOME_URL=`dbus get softcenter_home_url` + TAR_URL=$HOME_URL$URL_SPLIT$softcenter_installing_tar_url + FNAME=`basename $softcenter_installing_tar_url` + + if [ "$OLD_VERSION" = "" ]; then + OLD_VERSION=0 + fi + + CMP=`versioncmp $softcenter_installing_version $OLD_VERSION` + if [ -f /jffs/softcenter/webs/Module_$softcenter_installing_module.sh -o "$softcenter_installing_todo" = "softcenter" ]; then + CMP="-1" + fi + if [ "$CMP" = "-1" ]; then + + cd /tmp + rm -f $FNAME + rm -rf "/tmp/$softcenter_installing_module" + wget --no-check-certificate --tries=1 --timeout=15 $TAR_URL + RETURN_CODE=$? + + if [ "$RETURN_CODE" != "0" ]; then + dbus set softcenter_installing_status="12" + sleep 2 + + dbus set softcenter_installing_status="0" + dbus set softcenter_installing_module="" + dbus set softcenter_installing_todo="" + LOGGER "wget error, $RETURN_CODE" + exit 4 + fi + + md5sum_gz=$(md5sum /tmp/$FNAME | sed 's/ /\n/g'| sed -n 1p) + if [ "$md5sum_gz"x != "$softcenter_installing_md5"x ]; then + LOGGER "md5 not equal $md5sum_gz" + dbus set softcenter_installing_status="12" + rm -f $FNAME + sleep 2 + + dbus set softcenter_installing_status="0" + dbus set softcenter_installing_module="" + dbus set softcenter_installing_todo="" + + rm -f $FNAME + rm -rf "/tmp/$softcenter_installing_module" + exit + else + tar -zxf $FNAME + dbus set softcenter_installing_status="4" + + if [ ! -f /tmp/$softcenter_installing_module/install.sh ]; then + dbus set softcenter_installing_status="0" + dbus set softcenter_installing_module="" + dbus set softcenter_installing_todo="" + + #rm -f $FNAME + #rm -rf "/tmp/$softcenter_installing_module" + + LOGGER "package hasn't install.sh" + exit 5 + fi + + if [ -f /tmp/$softcenter_installing_module/uninstall.sh ]; then + chmod 755 /tmp/$softcenter_installing_module/uninstall.sh + mv /tmp/$softcenter_installing_module/uninstall.sh /jffs/softcenter/scripts/uninstall_$softcenter_installing_todo.sh + fi + + chmod a+x /tmp/$softcenter_installing_module/install.sh + sh /tmp/$softcenter_installing_module/install.sh + sleep 2 + + rm -f $FNAME + rm -rf "/tmp/$softcenter_installing_module" + + if [ "$softcenter_installing_module" != "softcenter" ]; then + dbus set "softcenter_module_$softcenter_installing_module$MD5_SUFFIX=$softcenter_installing_md5" + dbus set "softcenter_module_$softcenter_installing_module$VER_SUFFIX=$softcenter_installing_version" + dbus set "softcenter_module_$softcenter_installing_module$INSTALL_SUFFIX=1" + dbus set "$softcenter_installing_module$VER_SUFFIX=$softcenter_installing_version" + else + dbus set softcenter_version=$softcenter_installing_version; + dbus set softcenter_md5=$softcenter_installing_md5 + fi + dbus set softcenter_installing_module="" + dbus set softcenter_installing_todo="" + dbus set softcenter_installing_status="1" + fi + + else + LOGGER "current version is newest version" + dbus set softcenter_installing_status="13" + sleep 3 + + dbus set softcenter_installing_status="0" + dbus set softcenter_installing_module="" + dbus set softcenter_installing_todo="" + fi +} + +uninstall_module() { + if [ "$softcenter_installing_tick" = "" ]; then + export softcenter_installing_tick=0 + fi + LAST_TICK=`expr $softcenter_installing_tick + 20` + if [ "$LAST_TICK" -ge "$CURR_TICK" -a "$softcenter_installing_module" != "" ]; then + LOGGER "module $softcenter_installing_module is installing" + exit 2 + fi + + if [ "$softcenter_installing_todo" = "" -o "$softcenter_installing_todo" = "softcenter" ]; then + #curr module name not found + LOGGER "module name not found" + exit 3 + fi + + ENABLED=`dbus get "$softcenter_installing_todo""_enable"` + if [ "$ENABLED" = "1" ]; then + LOGGER "please disable this module than try again" + exit 4 + fi + + # Just ignore the old installing_module + export softcenter_installing_module=$softcenter_installing_todo + export softcenter_installing_tick=`date +%s` + export softcenter_installing_status="6" + dbus save softcenter_installing_ + + dbus remove "softcenter_module_$softcenter_installing_module$MD5_SUFFIX" + dbus remove "softcenter_module_$softcenter_installing_module$VER_SUFFIX" + dbus remove "softcenter_module_$softcenter_installing_module$INSTALL_SUFFIX" + + txt=`dbus list $softcenter_installing_todo` + printf "%s\n" "$txt" | + while IFS= read -r line; do + line2="${line%=*}" + if [ "$line2" != "" ]; then + dbus remove $line2 + fi + done + + sleep 3 + dbus set softcenter_installing_module="" + dbus set softcenter_installing_status="7" + dbus set softcenter_installing_todo="" + + #try to call uninstall script + if [ -f "/jffs/softcenter/scripts/$softcenter_installing_todo$UNINSTALL_SUFFIX.sh"]; then + sh /jffs/softcenter/scripts/$softcenter_installing_todo$UNINSTALL_SUFFIX.sh + elif [ -f "/jffs/softcenter/scripts/uninstall_$softcenter_installing_todo.sh" ]; then + sh /jffs/softcenter/scripts/uninstall_$softcenter_installing_todo.sh + else + rm -f /jffs/softcenter/webs/Module_$softcenter_installing_todo.asp + rm -f /jffs/softcenter/init.d/S*$softcenter_installing_todo.sh + fi +} + +LOGGER $BIN_NAME +case $BIN_NAME in +start) + sh /jffs/softcenter/perp/perp.sh start + ;; +update) + install_module + ;; +install) + install_module + ;; +ks_app_install) + install_module + ;; +ks_app_remove) + uninstall_module + ;; +*) + install_module + ;; +esac diff --git a/softcenter/softcenter/scripts/ks_app_remove.sh b/softcenter/softcenter/scripts/ks_app_remove.sh new file mode 120000 index 0000000..c49188a --- /dev/null +++ b/softcenter/softcenter/scripts/ks_app_remove.sh @@ -0,0 +1 @@ +/koolshare/scripts/ks_app_install.sh \ No newline at end of file diff --git a/softcenter/softcenter/scripts/ks_tar_intall.sh b/softcenter/softcenter/scripts/ks_tar_intall.sh new file mode 100755 index 0000000..3502876 --- /dev/null +++ b/softcenter/softcenter/scripts/ks_tar_intall.sh @@ -0,0 +1,57 @@ +#!/bin/sh + +#From dbus to local variable +eval `dbus export soft` +name=`echo "$soft_name"|cut -d "." -f1` +cat /dev/null > /tmp/syscmd.log +INSTALL_SUFFIX=_install +VER_SUFFIX=_version +cd /tmp + +echo $(date): 开启软件离线安装!>> /tmp/syscmd.log +if [ -f /tmp/$soft_name ];then + echo $(date): /tmp目录下检测到上传的离线安装包$soft_name >> /tmp/syscmd.log + echo $(date): 尝试解压离线安装包离线安装包 >> /tmp/syscmd.log + tar -zxvf $soft_name >/dev/null 2>&1 + echo $(date): 解压完成! >> /tmp/syscmd.log + if [ -f /tmp/$name/install.sh ];then + echo $(date): 找到安装脚本! >> /tmp/syscmd.log + echo $(date): 运行安装脚本... >> /tmp/syscmd.log + chmod +x /tmp/$name/install.sh >/dev/null 2>&1 + sh /tmp/$name/install.sh >/dev/null 2>&1 + dbus set "softcenter_module_$name$INSTALL_SUFFIX=1" + dbus set "softcenter_module_$name$VER_SUFFIX=$soft_install_version" + install_pid=`ps | grep install.sh | grep -v grep | awk '{print $1}'` + i=120 + until [ ! -n "$install_pid" ] + do + i=$(($i-1)) + if [ "$i" -lt 1 ];then + echo $(date): "Could not load nat rules!" + echo $(date): 安装似乎出了点问题,请手动重启路由器后重新尝试... >> /tmp/syscmd.log + echo $(date): 删除相关文件并退出... >> /tmp/syscmd.log + rm -rf /tmp/software + rm -rf /tmp/$soft_name + dbus remove "softcenter_module_$name$INSTALL_SUFFIX" + exit + fi + sleep 1 + done + echo $(date): 离线包安装完成! >> /tmp/syscmd.log + echo $(date): 一点点清理工作... >> /tmp/syscmd.log + rm -rf /tmp/$soft_name + echo $(date): 完成! >> /tmp/syscmd.log + else + echo $(date): 没有找到安装脚本! >> /tmp/syscmd.log + echo $(date): 删除相关文件并退出... >> /tmp/syscmd.log + rm -rf /tmp/$soft_name + + fi +else + echo $(date): 没有找到离线安装包! >> /tmp/syscmd.log + echo $(date): 删除相关文件并退出... >> /tmp/syscmd.log + rm -rf /tmp/software + rm -rf /tmp/$soft_name +fi + + rm -rf /tmp/$soft_name diff --git a/softcenter/softcenter/webs/Main_Soft_center.asp b/softcenter/softcenter/webs/Main_Soft_center.asp new file mode 100644 index 0000000..b6dc3ed --- /dev/null +++ b/softcenter/softcenter/webs/Main_Soft_center.asp @@ -0,0 +1,765 @@ + + + + + + + + + +Merlin software center + + + + + + + + + + + + + + + + + + +
+ + "/> + + + + + + + + + "> + "> + + + + + + + +
  + + + + + + + + +
+
+ + + + +
+
 
+
Software Center
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

+ + + + +
+
    +
  • +

    欢迎

    +
  • +
  • +

    欢迎来到插件中心,目前正在紧张开发中,各种插件酝酿中!

    +
  • +
  • +

    如果你想加入我们的工作,在 www.koolshare.cn 联系我们!

    +
  • + + +
  • +
    当前版本: 在线版本: +
    +
  • +
+
+
+
+ + +
+
更新中...
+
+
论坛技术支持: www.koolshare.cn +
Github项目: github.com/koolshare +
Powered by: koolshare开发组 +
修改版 by: paldier +
+
+
+
+
+ + + diff --git a/softcenter/softcenter/webs/Main_Soft_setting.asp b/softcenter/softcenter/webs/Main_Soft_setting.asp new file mode 100644 index 0000000..7c43048 --- /dev/null +++ b/softcenter/softcenter/webs/Main_Soft_setting.asp @@ -0,0 +1,257 @@ + + + + + + + + + +软件中心 - 离线安装 + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + "/> + + "/> + + + + + + + +
  + + + + + + + + + +
+ + + + +
+
 
+
软件中心,离线安装页面
+
+
+
+
+
  • 此页面功能需要在7.0及其以上的固件才能使用。
  • +
  • 通过本页面,你可以上传插件的离线安装包来安装插件;
  • +
  • 离线安装会自动解压tar.gz后缀的压缩包,识别压缩包一级目录下的install.sh文件并执行;
  • +
  • 建议开发者将插件版本号,md5等信息在install.sh文件内进行写入;
  • +
  • 此页面也能用来安装SS离线安装包,方便用户进行回滚操作,上传前需要将历史文件包改名为shadowsocks.tar.gz,建议安装时关闭SS,安装后需要重新提交才能看到安装的版本号;
  • +
    + +
    + + + + + + + + + + + + + + + + + + + +
    软件中心 - 高级设置
    安装包版本号 + +
    离线安装插件 + + + + + +
    +
    + +
    +
    +
    +
    论坛技术支持: www.koolshare.cn
    + 后台技术支持: Xiaobao
    + Shell, Web by: Sadoneli
    +
    + +
    +
    +
    +
    + + + + + + + diff --git a/softcenter/tests/test_app.sh b/softcenter/tests/test_app.sh new file mode 100755 index 0000000..84ab9f3 --- /dev/null +++ b/softcenter/tests/test_app.sh @@ -0,0 +1,127 @@ +#!/bin/sh + +#dbus set softcenter_home_url="https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui" +#dbus set softcenter_home_url="https://raw.githubusercontent.com/koolshare/koolshare.github.io/acelan_softcenter_ui" +dbus set softcenter_home_url="http://koolshare.ngrok.wang:5000" + + +#test001, normal installing +dbus remove adm_version +dbus remove adm_md5 + +#export softcenter_installing_module +#export softcenter_installing_tick +export softcenter_installing_todo=adm +export softcenter_installing_version=0.5 +export softcenter_installing_md5=a9148835ab402d8f1ba920aea40011a3 +export softcenter_installing_tar_url="adm/adm.tar.gz" +dbus save softcenter_installing + +sh /koolshare/scripts/app_install.sh + +rlt=`dbus get softcenter_installing_status` +if [ "$rlt" != "1" ]; then + echo "test001 failed" + exit +fi + +#test002, normal udpating +dbus set adm_version=0.4 + +#export softcenter_installing_module +#export softcenter_installing_tick +export softcenter_installing_todo=adm +export softcenter_installing_version=0.5 +export softcenter_installing_md5=a9148835ab402d8f1ba920aea40011a3 +export softcenter_installing_tar_url="adm/adm.tar.gz" +dbus save softcenter_installing + +sh /koolshare/scripts/app_install.sh + +rlt=`dbus get softcenter_installing_status` +if [ "$rlt" != "1" ]; then + echo "test002 failed" + exit +fi + + +#test003, prefix exists but timeout +dbus set adm_version=0.4 + +export softcenter_installing_module=shadowvpn +export softcenter_installing_tick=10000 +export softcenter_installing_todo=adm +export softcenter_installing_version=0.5 +export softcenter_installing_md5=a9148835ab402d8f1ba920aea40011a3 +export softcenter_installing_tar_url="adm/adm.tar.gz" +dbus save softcenter_installing + +sh /koolshare/scripts/app_install.sh + +rlt=`dbus get softcenter_installing_status` +if [ "$rlt" != "1" ]; then + echo "test003 failed" + exit +fi + + +#test004, the newest version +dbus set adm_version=0.5 + +#export softcenter_installing_module=shadowvpn +#export softcenter_installing_tick=10000 +export softcenter_installing_todo=adm +export softcenter_installing_version=0.5 +export softcenter_installing_md5=a9148835ab402d8f1ba920aea40011a3 +export softcenter_installing_tar_url="adm/adm.tar.gz" +dbus save softcenter_installing + +sh /koolshare/scripts/app_install.sh + +rlt=`dbus get softcenter_installing_status` +if [ "$rlt" == "1" ]; then + echo "test004 failed" + exit +fi + + +#test005, prefix installing exits and not timeout +dbus set adm_version=0.4 + +export softcenter_installing_module=shadowvpn +export softcenter_installing_tick=`date +%s` +export softcenter_installing_todo=adm +export softcenter_installing_version=0.5 +export softcenter_installing_md5=a9148835ab402d8f1ba920aea40011a3 +export softcenter_installing_tar_url="adm/adm.tar.gz" +dbus save softcenter_installing + +sh /koolshare/scripts/app_install.sh + +rlt=`dbus get softcenter_installing_status` +if [ "$rlt" == "1" ]; then + echo "test005 failed" + exit +fi + + +#test006, home_url timeout +dbus set softcenter_home_url="http://koolshare.ngrok.wang:50000" +dbus set adm_version=0.4 + +export softcenter_installing_module= +export softcenter_installing_tick= +export softcenter_installing_todo=adm +export softcenter_installing_version=0.5 +export softcenter_installing_md5=a9148835ab402d8f1ba920aea40011a3 +export softcenter_installing_tar_url="adm/adm.tar.gz" +dbus save softcenter_installing + +sh /koolshare/scripts/app_install.sh + +rlt=`dbus get softcenter_installing_status` +echo "result $rlt" +if [ "$rlt" == "1" ]; then + echo "test006 failed" + exit +fi diff --git a/softcenter/tests/test_app_one.sh b/softcenter/tests/test_app_one.sh new file mode 100755 index 0000000..cbb479f --- /dev/null +++ b/softcenter/tests/test_app_one.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +#dbus set softcenter_home_url="https://github.com/koolshare/koolshare.github.io/blob/acelan_softcenter_ui" +#dbus set softcenter_home_url="https://raw.githubusercontent.com/koolshare/koolshare.github.io/acelan_softcenter_ui" +dbus set softcenter_home_url="http://koolshare.ngrok.wang:5000" + + +#test001, normal installing +#dbus remove adm_version +#dbus remove adm_md5 + +#export softcenter_installing_module +#export softcenter_installing_tick +export softcenter_installing_todo=adm +export softcenter_installing_version=0.5 +export softcenter_installing_md5=153ca93835ad7ac6a8fecd55f5b9bac5 +export softcenter_installing_tar_url="adm/adm.tar.gz" +dbus save softcenter_installing + +sh /koolshare/scripts/ks_app_install.sh + +rlt=`dbus get softcenter_installing_status` +if [ "$rlt" != "1" ]; then + echo "test001 failed" + exit +fi diff --git a/softcenter/tests/test_app_remove.sh b/softcenter/tests/test_app_remove.sh new file mode 100644 index 0000000..3f4433f --- /dev/null +++ b/softcenter/tests/test_app_remove.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +dbus set softcenter_home_url="http://koolshare.ngrok.wang:5000" +dbus set softcenter_installing_todo=adm + +sh /koolshare/scripts/app_remove.sh diff --git a/softcenter/version b/softcenter/version new file mode 100644 index 0000000..596e871 --- /dev/null +++ b/softcenter/version @@ -0,0 +1,2 @@ +1.1.6 +3242715f2a71bec3ffc70252f92c977b