add reboot in reset_rom_pkgs
This commit is contained in:
parent
8535e08fd8
commit
c3461db99b
@ -2,6 +2,7 @@ local util = require "luci.util"
|
||||
local http = require "luci.http"
|
||||
local lng = require "luci.i18n"
|
||||
local iform = require "luci.iform"
|
||||
local jsonc = require "luci.jsonc"
|
||||
|
||||
module("luci.controller.systools", package.seeall)
|
||||
|
||||
@ -29,10 +30,10 @@ function systools_form()
|
||||
local scope = ""
|
||||
local success = 0
|
||||
|
||||
local data = get_data()
|
||||
local data, extra = get_data()
|
||||
local result = {
|
||||
data = data,
|
||||
schema = get_schema(data)
|
||||
schema = get_schema(data, extra)
|
||||
}
|
||||
local response = {
|
||||
error = error,
|
||||
@ -44,7 +45,7 @@ function systools_form()
|
||||
http.write_json(response)
|
||||
end
|
||||
|
||||
function get_schema(data)
|
||||
function get_schema(data, extra)
|
||||
local actions
|
||||
actions = {
|
||||
{
|
||||
@ -55,75 +56,98 @@ function get_schema(data)
|
||||
}
|
||||
local schema = {
|
||||
actions = actions,
|
||||
containers = get_containers(data),
|
||||
description = lng.translate("SysTools can fix some errors when your system is broken."),
|
||||
containers = get_containers(data, extra),
|
||||
description = lng.translate("Some convenient tools which can fix some errors."),
|
||||
title = lng.translate("SysTools")
|
||||
}
|
||||
return schema
|
||||
end
|
||||
|
||||
function get_containers(data)
|
||||
function get_containers(data, extra)
|
||||
local containers = {
|
||||
status_container(data),
|
||||
main_container(data)
|
||||
main_container(data, extra)
|
||||
}
|
||||
return containers
|
||||
end
|
||||
|
||||
function status_container(data)
|
||||
local status_c1 = {
|
||||
labels = {
|
||||
{
|
||||
key = "访问:",
|
||||
value = ""
|
||||
}
|
||||
},
|
||||
description = lng.translate("The running status"),
|
||||
title = lng.translate("Status")
|
||||
}
|
||||
return status_c1
|
||||
function main_container(data, extra)
|
||||
local speedServerEnums = {}
|
||||
local speedServerNames = {}
|
||||
if data["tool"] == "speedtest" then
|
||||
speedServerEnums[#speedServerEnums+1] = "auto"
|
||||
speedServerNames[#speedServerNames+1] = "Auto Select"
|
||||
for key, val in pairs(extra.speedTestServers) do
|
||||
speedServerEnums[#speedServerEnums+1] = key
|
||||
speedServerNames[#speedServerNames+1] = val
|
||||
end
|
||||
end
|
||||
local main_c2 = {
|
||||
properties = {
|
||||
{
|
||||
name = "tool",
|
||||
required = true,
|
||||
title = "可执行操作",
|
||||
type = "string",
|
||||
enum = {"turn_off_ipv6", "reset_rom_pkgs", "qb_reset_password", "disk_power_mode", "speedtest"},
|
||||
enumNames = {
|
||||
lng.translate("Turn off IPv6"),
|
||||
lng.translate("Reset rom pkgs"),
|
||||
lng.translate("Reset qBittorrent Password"),
|
||||
lng.translate("HDD hibernation Status"),
|
||||
lng.translate("Run SpeedTest")
|
||||
}
|
||||
},
|
||||
{
|
||||
name = "speedTestServer",
|
||||
title = "Servers",
|
||||
type = "string",
|
||||
["ui:hidden"] = "{{rootValue.tool !== 'speedtest' }}",
|
||||
enum = speedServerEnums,
|
||||
enumNames = speedServerNames
|
||||
},
|
||||
},
|
||||
description = lng.translate("Select the action to run:"),
|
||||
title = lng.translate("Actions")
|
||||
}
|
||||
return main_c2
|
||||
end
|
||||
|
||||
function main_container(data)
|
||||
local main_c2 = {
|
||||
properties = {
|
||||
{
|
||||
name = "testName",
|
||||
required = true,
|
||||
title = "测试变化",
|
||||
type = "string",
|
||||
enum = {"test1", "test2"},
|
||||
enumNames = {"Test1", "Test2"}
|
||||
},
|
||||
{
|
||||
name = "tool",
|
||||
required = true,
|
||||
title = "可执行操作",
|
||||
type = "string",
|
||||
enum = {"speedtest", "reset_rom"},
|
||||
enumNames = {"网络测速", "恢复系统软件包"}
|
||||
},
|
||||
{
|
||||
name = "server",
|
||||
title = "Servers",
|
||||
type = "string",
|
||||
["ui:hidden"] = "{{rootValue.tool !== 'speedtest' }}",
|
||||
enum = {"server1", "server2"},
|
||||
enumNames = {"ServerTest1", "ServerTest2"}
|
||||
},
|
||||
},
|
||||
description = lng.translate("Select the action to run:"),
|
||||
title = lng.translate("Actions")
|
||||
}
|
||||
return main_c2
|
||||
function get_speedtest_servers()
|
||||
local vals = {}
|
||||
local f = io.popen("/usr/share/systools/speedtest-servers.run", "r")
|
||||
if f then
|
||||
local ret = f:read("*all")
|
||||
f:close()
|
||||
local obj = jsonc.parse(ret)
|
||||
if obj == nil then
|
||||
return vals
|
||||
end
|
||||
for _, val in pairs(obj["servers"]) do
|
||||
if type(val["name"]) == "number" then
|
||||
vals[tostring(val["id"])] = string.format("%s,%s", val["location"], val["country"])
|
||||
else
|
||||
vals[tostring(val["id"])] = string.format("%s,%s,%s", val["name"], val["location"], val["country"])
|
||||
end
|
||||
end
|
||||
end
|
||||
return vals
|
||||
end
|
||||
|
||||
function get_data()
|
||||
local tool = luci.http.formvalue("tool")
|
||||
local extra = {}
|
||||
if tool then
|
||||
if tool == "speedtest" then
|
||||
extra["speedTestServers"] = get_speedtest_servers()
|
||||
end
|
||||
else
|
||||
tool = "turn_off_ipv6"
|
||||
end
|
||||
local data = {
|
||||
testName = 'test1',
|
||||
tool = "reset_rom",
|
||||
tool = tool,
|
||||
speedTestServer = "auto"
|
||||
}
|
||||
return data
|
||||
return data, extra
|
||||
end
|
||||
|
||||
function systools_submit()
|
||||
@ -132,10 +156,8 @@ function systools_submit()
|
||||
local success = 0
|
||||
local result
|
||||
|
||||
local jsonc = require "luci.jsonc"
|
||||
local json_parse = jsonc.parse
|
||||
local content = http.content()
|
||||
local req = json_parse(content)
|
||||
local req = jsonc.parse(content)
|
||||
if req["$apply"] == "install" then
|
||||
result = install_execute_systools(req)
|
||||
end
|
||||
@ -150,10 +172,13 @@ function systools_submit()
|
||||
end
|
||||
|
||||
function install_execute_systools(req)
|
||||
local password = req["tool"]
|
||||
local port = req["server"]
|
||||
|
||||
cmd = "/etc/init.d/tasks task_add systools " .. luci.util.shellquote(string.format("/usr/libexec/istorec/systools.sh %s", req["$apply"]))
|
||||
local cmd
|
||||
if req["tool"] == "speedtest" then
|
||||
cmd = string.format("/usr/libexec/istorec/systools.sh %s %s", req["tool"], req["speedTestServer"])
|
||||
else
|
||||
cmd = string.format("/usr/libexec/istorec/systools.sh %s", req["tool"])
|
||||
end
|
||||
cmd = "/etc/init.d/tasks task_add systools " .. luci.util.shellquote(cmd)
|
||||
os.execute(cmd .. " >/dev/null 2>&1")
|
||||
|
||||
local result = {
|
||||
|
@ -17,16 +17,15 @@
|
||||
submitApi:"/cgi-bin/luci/admin/services/systools/submit",
|
||||
getHook:function(resp){
|
||||
window.IstoreosData = resp.result.data;
|
||||
console.log("resp=", resp.result.data);
|
||||
//console.log("resp=", resp.result.data);
|
||||
return resp;
|
||||
},
|
||||
onFormChange: function(changedField, val) {
|
||||
console.log("changedField=", changedField, "formChanged=", val)
|
||||
if (changedField === "tool" && window.IstoreosData["tool"] !== val["tool"]) {
|
||||
val["reload"] = true;
|
||||
val["tool"] = 'test'
|
||||
const loading = true
|
||||
window.istoreos.reloadFromGetApi(val, loading)
|
||||
//console.log("changedField=", changedField, "formData=", val)
|
||||
if (changedField === "tool" &&
|
||||
val["tool"] == "speedtest" &&
|
||||
window.IstoreosData["tool"] !== val["tool"]) {
|
||||
window.istoreos.reloadFromGetApi(val, true)
|
||||
}
|
||||
},
|
||||
submitHook:function(params){
|
||||
|
@ -4,5 +4,27 @@ msgstr "系统工具"
|
||||
msgid "Execute"
|
||||
msgstr "执行"
|
||||
|
||||
msgid "SysTools can fix some errors when your system is broken."
|
||||
msgstr "SysTools 可以修复一些系统问题。"
|
||||
msgid "Some convenient tools which can fix some errors."
|
||||
msgstr "一些便利的工具集,方便修复一些问题。"
|
||||
|
||||
msgid "Reset rom pkgs"
|
||||
msgstr "修复系统软件"
|
||||
|
||||
msgid "Turn off IPv6"
|
||||
msgstr "关闭 IPv6"
|
||||
|
||||
msgid "Reset qBittorrent Password"
|
||||
msgstr "重置 qBittorrent 密码"
|
||||
|
||||
msgid "HDD hibernation Status"
|
||||
msgstr "查看硬盘休眠"
|
||||
|
||||
msgid "Run SpeedTest"
|
||||
msgstr "外网测速"
|
||||
|
||||
msgid "Select the action to run:"
|
||||
msgstr "选择执行的操作:"
|
||||
|
||||
msgid "Actions"
|
||||
msgstr "操作"
|
||||
|
||||
|
@ -4,43 +4,35 @@
|
||||
ACTION=${1}
|
||||
shift 1
|
||||
|
||||
do_install() {
|
||||
echo "starting"
|
||||
sleep 120
|
||||
echo "started"
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "usage: $0 sub-command"
|
||||
echo "where sub-command is one of:"
|
||||
echo " install Install the emby"
|
||||
echo " upgrade Upgrade the emby"
|
||||
echo " rm/start/stop/restart Remove/Start/Stop/Restart the emby"
|
||||
echo " status Emby status"
|
||||
echo " port Emby port"
|
||||
echo " turn_off_ipv6 Disable IPv6"
|
||||
echo " reset_rom_pkgs Reset pkgs from rom"
|
||||
echo " qb_reset_password Reset qBitorent password"
|
||||
echo " disk_power_mode Show disk power status"
|
||||
echo " speedtest Start a speedtest"
|
||||
}
|
||||
|
||||
case ${ACTION} in
|
||||
"install")
|
||||
do_install
|
||||
"turn_off_ipv6")
|
||||
/usr/share/systools/turn_off_ipv6.run
|
||||
;;
|
||||
"upgrade")
|
||||
do_install
|
||||
"reset_rom_pkgs")
|
||||
/usr/share/systools/reset_rom_pkgs.run
|
||||
;;
|
||||
"rm")
|
||||
docker rm -f emby
|
||||
"qb_reset_password")
|
||||
/usr/share/systools/qb_reset_password.run
|
||||
;;
|
||||
"start" | "stop" | "restart")
|
||||
docker ${ACTION} emby
|
||||
"disk_power_mode")
|
||||
/usr/share/systools/disk_power_mode.run
|
||||
;;
|
||||
"status")
|
||||
docker ps --all -f 'name=emby' --format '{{.State}}'
|
||||
;;
|
||||
"port")
|
||||
docker ps --all -f 'name=emby' --format '{{.Ports}}' | grep -om1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://'
|
||||
"speedtest")
|
||||
/usr/share/systools/speedtest.run ${1}
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
|
72
applications/luci-app-systools/root/usr/share/systools/disk_power_mode.run
Executable file
72
applications/luci-app-systools/root/usr/share/systools/disk_power_mode.run
Executable file
@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
#function-1:显示硬盘盘符+Lable+容量以及硬盘上电状态
|
||||
#function-2:通过echo -e转义与if...elif...else语句使其active呈现红色,standby呈现绿色,方便快速检视硬盘上电情况
|
||||
#function-3:原for循环语句中加入判断和循环计数方式,统计active和standby的数量
|
||||
#function-4:增加 if 嵌套语句判断除开 active 和 standby 之外状态的硬盘,并将其标记为 unknown
|
||||
#function-5:将unknown状态的硬盘列举出来(对for语句上瘾了……
|
||||
|
||||
dsk=`ls /dev/sd* | grep -Eo 'sd(a{2}|[a-z]+)$'`
|
||||
echo `date +%c`
|
||||
standby=0
|
||||
active=0
|
||||
unknown=0
|
||||
c=0
|
||||
|
||||
if readlink /proc/$$/fd/1 2>/dev/null | grep -qF /dev/ ; then
|
||||
highlight(){
|
||||
echo -e "$1 $2 \033[0m"
|
||||
}
|
||||
else
|
||||
highlight(){
|
||||
echo -e "$2"
|
||||
}
|
||||
fi
|
||||
|
||||
for i in $dsk;
|
||||
do
|
||||
echo -e "\n";
|
||||
echo -e "-----------------------";
|
||||
echo -n "/dev/$i : " ;
|
||||
stats=`smartctl -i -n standby /dev/$i|grep "mode"|awk '{print $4}' `;
|
||||
#echo $stats
|
||||
if [[ $stats == STANDBY ]]||[[ $stats == ACTIVE ]]||[[ $stats == IDLE_A ]]
|
||||
then
|
||||
for s in $stats;
|
||||
do
|
||||
if [ $s == STANDBY ]
|
||||
then
|
||||
highlight "\033[30;42m" " STANDBY "
|
||||
let standby=$standby+1
|
||||
else
|
||||
highlight "\033[37;41m" " ACTIVE "
|
||||
let active=$active+1
|
||||
fi
|
||||
done
|
||||
else
|
||||
highlight "\033[30;47m" " UNKNOWN "
|
||||
let unknown=$unknown+1
|
||||
for un in $i
|
||||
do
|
||||
list[c]=$un
|
||||
((c++))
|
||||
done
|
||||
fi
|
||||
echo `lsblk /dev/$i|grep "/srv/dev-disk-by-label-"|awk '{print $7}' `;
|
||||
echo `lsblk /dev/$i|grep "/srv/dev-disk-by-label-"|awk '{print $4}' `;
|
||||
done
|
||||
|
||||
echo -e "\n";
|
||||
highlight "\033[37;41m" "Active Disk in Total=$active ";
|
||||
highlight "\033[30;42m" "Standby Disk in Total=$standby ";
|
||||
highlight "\033[30;47m" "Unknown Disk in Total=$unknown ";
|
||||
#echo $c
|
||||
echo -e "Unknown Disk list: ";
|
||||
for((b=0;b<=$c;b++));
|
||||
do
|
||||
if [[ $b -lt $c ]]
|
||||
then
|
||||
echo ${list[b]}
|
||||
fi
|
||||
done
|
||||
echo -e "\n";
|
||||
exit
|
16
applications/luci-app-systools/root/usr/share/systools/fw_wxedge.run
Executable file
16
applications/luci-app-systools/root/usr/share/systools/fw_wxedge.run
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete firewall.wxedge
|
||||
set firewall.wxedge=rule
|
||||
set firewall.wxedge.name="wxedge"
|
||||
set firewall.wxedge.target="ACCEPT"
|
||||
set firewall.wxedge.src="wan"
|
||||
set firewall.wxedge.dest_port="40000-65535"
|
||||
set firewall.wxedge.enabled="1"
|
||||
commit firewall
|
||||
EOF
|
||||
|
||||
/etc/init.d/firewall reload
|
||||
|
||||
echo "done"
|
46
applications/luci-app-systools/root/usr/share/systools/jellyfin_host.run
Executable file
46
applications/luci-app-systools/root/usr/share/systools/jellyfin_host.run
Executable file
@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
# @jjm2473
|
||||
|
||||
hosts() {
|
||||
cat <<-EOF
|
||||
api.themoviedb.org 13.35.67.86
|
||||
image.tmdb.org 104.16.61.155
|
||||
www.themoviedb.org 54.192.151.79
|
||||
EOF
|
||||
}
|
||||
|
||||
filter() {
|
||||
local EXISTED=`uci show dhcp | grep -E '^dhcp\.@domain\[\d+\]\.name=' | sed 's/.*=//g'"; s/'//g" | sort -u`
|
||||
if [ "x$EXISTED" = "x" ]; then
|
||||
cat
|
||||
else
|
||||
grep -vFwe "$EXISTED"
|
||||
fi
|
||||
}
|
||||
add_host() {
|
||||
[ "x$1" = "x" -o "x$2" = "x" ] && return
|
||||
echo "set $1 = $2"
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
add dhcp domain
|
||||
set dhcp.@domain[-1].name=$1
|
||||
set dhcp.@domain[-1].ip=$2
|
||||
EOF
|
||||
}
|
||||
add_hosts() {
|
||||
local line
|
||||
while read; do
|
||||
line="$REPLY"
|
||||
add_host $line
|
||||
done
|
||||
if [ -n "`uci changes dhcp`" ]; then
|
||||
echo "commit changes and reload dnsmasq"
|
||||
uci commit dhcp
|
||||
/etc/init.d/dnsmasq reload
|
||||
else
|
||||
echo "there is nothing to do"
|
||||
fi
|
||||
}
|
||||
|
||||
hosts | filter | add_hosts
|
||||
|
||||
echo "done"
|
9
applications/luci-app-systools/root/usr/share/systools/net_check.run
Executable file
9
applications/luci-app-systools/root/usr/share/systools/net_check.run
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
date
|
||||
|
||||
nslookup baidu.com
|
||||
|
||||
ping -c 4 baidu.com
|
||||
|
||||
curl -o /dev/null https://www.baidu.com/
|
17
applications/luci-app-systools/root/usr/share/systools/qb_reset_password.run
Executable file
17
applications/luci-app-systools/root/usr/share/systools/qb_reset_password.run
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
profile=`uci get qbittorrent.main.profile`
|
||||
if [ -n "$profile" ]; then
|
||||
echo "qb profile: $profile"
|
||||
echo "stop qb"
|
||||
/etc/init.d/qbittorrent stop
|
||||
sleep 2
|
||||
echo "delete password"
|
||||
sed -i '/^WebUI\\Password_/d' "$profile/qBittorrent/config/qBittorrent.conf"
|
||||
echo "start qb"
|
||||
/etc/init.d/qbittorrent start
|
||||
else
|
||||
echo "profile not defined!"
|
||||
fi
|
||||
|
||||
echo "done"
|
64
applications/luci-app-systools/root/usr/share/systools/reset_rom_pkgs.run
Executable file
64
applications/luci-app-systools/root/usr/share/systools/reset_rom_pkgs.run
Executable file
@ -0,0 +1,64 @@
|
||||
#!/bin/sh
|
||||
|
||||
nonconf_files_of_pkg() {
|
||||
local pkgname="$1"
|
||||
if [ -s /rom/usr/lib/opkg/info/${pkgname}.conffiles ]; then
|
||||
grep -hvxFf /rom/usr/lib/opkg/info/${pkgname}.conffiles \
|
||||
/rom/usr/lib/opkg/info/${pkgname}.list
|
||||
else
|
||||
cat /rom/usr/lib/opkg/info/${pkgname}.list
|
||||
fi
|
||||
}
|
||||
|
||||
reset_pkg() {
|
||||
local pkgname="$1"
|
||||
local line
|
||||
local dep
|
||||
local deps
|
||||
echo "${pkgname}" | grep -q "^kmod-\
|
||||
^kernel$\
|
||||
^libc$\
|
||||
^libgcc1$\
|
||||
^libatomic1$\
|
||||
^busybox$\
|
||||
" && return
|
||||
if [ -f /rom/usr/lib/opkg/info/${pkgname}.control -a -e /overlay/upper/usr/lib/opkg/info/${pkgname}.control ]; then
|
||||
echo "reset ${pkgname}"
|
||||
if [ -f /rom/usr/lib/opkg/info/${pkgname}.list ]; then
|
||||
nonconf_files_of_pkg "${pkgname}" | while read; do
|
||||
line="$REPLY"
|
||||
rm -f "/overlay/upper/${line}"
|
||||
done
|
||||
rm -f /overlay/upper/usr/lib/opkg/info/${pkgname}.list
|
||||
fi
|
||||
deps=`grep '^Depends: ' /rom/usr/lib/opkg/info/${pkgname}.control | dd bs=1 skip=8 2>/dev/null | sed 's/,/ /g'`
|
||||
# avoid loop deps
|
||||
rm -f /overlay/upper/usr/lib/opkg/info/${pkgname}.control
|
||||
for dep in $deps ; do
|
||||
reset_pkg "$dep"
|
||||
done
|
||||
rm -f /overlay/upper/usr/lib/opkg/info/${pkgname}.*
|
||||
fi
|
||||
}
|
||||
|
||||
ls_all_rom_pkgs() {
|
||||
( cd /rom/usr/lib/opkg/info ; find . -maxdepth 1 -name '*.control' | sed -E 's#./(.*).control#\1#g' )
|
||||
}
|
||||
|
||||
reset_all_rom() {
|
||||
local line
|
||||
ls_all_rom_pkgs | while read; do
|
||||
line="$REPLY"
|
||||
reset_pkg "$line"
|
||||
done
|
||||
}
|
||||
|
||||
reset_all_rom
|
||||
|
||||
touch /overlay/upper/usr/lib/opkg/.upgrading
|
||||
|
||||
echo "done, please reboot, it will reboot in 10s"
|
||||
|
||||
sleep 10
|
||||
reboot
|
||||
|
34
applications/luci-app-systools/root/usr/share/systools/speedtest-servers.run
Executable file
34
applications/luci-app-systools/root/usr/share/systools/speedtest-servers.run
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
|
||||
export PATH=/usr/bin:/sbin:/bin/usr/bin:/sbin:/bin
|
||||
export HOME=/root
|
||||
export GATEWAY_INTERFACE=
|
||||
export REMOTE_HOST=
|
||||
export REMOTE_ADDR=
|
||||
export SHLVL=
|
||||
export QUERY_STRING=
|
||||
export HTTP_USER_AGENT=
|
||||
export DOCUMENT_ROOT=
|
||||
export REMOTE_PORT=
|
||||
export HTTP_ACCEPT=
|
||||
export SCRIPT_FILENAME=
|
||||
export HTTP_HOST=
|
||||
export REQUEST_URI=
|
||||
export SERVER_SOFTWARE=
|
||||
export HTTP_CONNECTION=
|
||||
export HTTP_COOKIE=
|
||||
export HTTP_ACCEPT_LANGUAGE=
|
||||
export SERVER_PROTOCOL=
|
||||
export HTTP_ACCEPT_ENCODING=
|
||||
export PATH_INFO=
|
||||
export REDIRECT_STATUS=
|
||||
export REQUEST_METHOD=
|
||||
export SERVER_ADDR=
|
||||
export PWD=
|
||||
export SERVER_PORT=
|
||||
export SCRIPT_NAME=
|
||||
export SERVER_NAME=
|
||||
export TERM=screen-256color
|
||||
|
||||
/usr/bin/speedtest --format=json --accept-license --accept-gdpr --servers 2>/dev/null
|
||||
|
13
applications/luci-app-systools/root/usr/share/systools/speedtest.run
Executable file
13
applications/luci-app-systools/root/usr/share/systools/speedtest.run
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd /root
|
||||
export HOME=/root
|
||||
SERVER=${1}
|
||||
|
||||
echo "run speedtest"
|
||||
if [ "$SERVER" == "auto" ]; then
|
||||
echo "yes"|/usr/bin/speedtest
|
||||
else
|
||||
echo "yes"|/usr/bin/speedtest -s $SERVER
|
||||
fi
|
||||
|
31
applications/luci-app-systools/root/usr/share/systools/turn_off_ipv6.run
Executable file
31
applications/luci-app-systools/root/usr/share/systools/turn_off_ipv6.run
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "uci settings"
|
||||
|
||||
uci -q batch <<-EOF
|
||||
del dhcp.lan.ra
|
||||
del dhcp.lan.dhcpv6
|
||||
del dhcp.lan.ra_flags
|
||||
add_list dhcp.lan.ra_flags=none
|
||||
|
||||
set network.wan.ipv6='0'
|
||||
del dhcp.wan.ra_flags
|
||||
add_list dhcp.wan.ra_flags=none
|
||||
|
||||
set network.wan6.auto=0
|
||||
|
||||
set dhcp.@dnsmasq[0].filter_aaaa='1'
|
||||
|
||||
commit network
|
||||
commit dhcp
|
||||
EOF
|
||||
|
||||
echo "reload_config"
|
||||
reload_config
|
||||
echo -n "wait for device online"
|
||||
for i in `seq 10 -1 1`; do
|
||||
echo -n "."
|
||||
sleep 1
|
||||
done
|
||||
echo ""
|
||||
echo "done"
|
Loading…
x
Reference in New Issue
Block a user