update
This commit is contained in:
17
static/404.html
Normal file
17
static/404.html
Normal file
File diff suppressed because one or more lines are too long
@@ -102,7 +102,7 @@ document.write("您是到访的第" + visits + "位用户!")
|
||||
|
||||
|
||||
<footer>
|
||||
版权 © <span class="year">2023</span> <a href="http://www.ecoo.top/">www.ecoo.top</a>
|
||||
版权 © <span class="year">2025</span> <a href="http://www.ecoo.top/">www.ecoo.top</a>
|
||||
</footer>
|
||||
<br/><br/>
|
||||
|
||||
|
||||
111
static/ad.html
Normal file
111
static/ad.html
Normal file
@@ -0,0 +1,111 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>海纳思系统官方通告</title>
|
||||
<style>
|
||||
body {
|
||||
width: 40em;
|
||||
margin: 0 auto;
|
||||
font-family: Tahoma, Verdana, Arial, sans-serif;
|
||||
}
|
||||
.content pre{
|
||||
position: relative;
|
||||
background-color: #f5f5f5;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
padding: 10px;
|
||||
}
|
||||
pre .btn-pre-copy{
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
user-select: none;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 12px;
|
||||
font-size: 12px;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
color: hsla(0,0%,54.9%,.8);
|
||||
transition: color .1s;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<h1>海纳思系统官方广告位招租</h1>
|
||||
</header>
|
||||
|
||||
<h2>22000+装机数</h2>
|
||||
<h2>日活6000+</h2>
|
||||
<h2>日增约100台</h2>
|
||||
<h2>要求:符合海纳思服务器的环境需求</h2>
|
||||
<h2>捐助并投放,与作者共赢!请联系本站</h2>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<script language="JavaScript">
|
||||
<!--
|
||||
var caution = false
|
||||
function setCookie(name, value, expires, path, domain, secure) {
|
||||
var curCookie = name + "=" + escape(value) +
|
||||
((expires) ? "; expires=" + expires.toGMTString() : "") +
|
||||
((path) ? "; path=" + path : "") +
|
||||
((domain) ? "; domain=" + domain : "") +
|
||||
((secure) ? "; secure" : "")
|
||||
if (!caution || (name + "=" + escape(value)).length <= 4000)
|
||||
document.cookie = curCookie
|
||||
else
|
||||
if (confirm("Cookie exceeds 4KB and will be cut!"))
|
||||
document.cookie = curCookie
|
||||
}
|
||||
function getCookie(name) {
|
||||
var prefix = name + "="
|
||||
var cookieStartIndex = document.cookie.indexOf(prefix)
|
||||
if (cookieStartIndex == -1)
|
||||
return null
|
||||
var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)
|
||||
if (cookieEndIndex == -1)
|
||||
cookieEndIndex = document.cookie.length
|
||||
return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
|
||||
}
|
||||
function deleteCookie(name, path, domain) {
|
||||
if (getCookie(name)) {
|
||||
document.cookie = name + "=" +
|
||||
((path) ? "; path=" + path : "") +
|
||||
((domain) ? "; domain=" + domain : "") +
|
||||
"; expires=Thu, 01-Jan-70 00:00:01 GMT"
|
||||
}
|
||||
}
|
||||
function fixDate(date) {
|
||||
var base = new Date(0)
|
||||
var skew = base.getTime()
|
||||
if (skew > 0)
|
||||
date.setTime(date.getTime() - skew)
|
||||
}
|
||||
var now = new Date()
|
||||
fixDate(now)
|
||||
now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000)
|
||||
var visits = getCookie("counter")
|
||||
if (!visits)
|
||||
visits = 1
|
||||
else
|
||||
visits = parseInt(visits) + 1
|
||||
setCookie("counter", visits, now)
|
||||
document.write("您是到访的第" + visits + "位用户!")
|
||||
// -->
|
||||
</script>
|
||||
|
||||
|
||||
<footer>
|
||||
版权 © <span class="year">2025</span> <a href="http://www.ecoo.top/">www.ecoo.top</a>
|
||||
</footer>
|
||||
<br/><br/>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
BIN
static/ad.jpg
BIN
static/ad.jpg
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 86 KiB |
BIN
static/ad.pdf
BIN
static/ad.pdf
Binary file not shown.
1
static/ad_count.txt
Normal file
1
static/ad_count.txt
Normal file
@@ -0,0 +1 @@
|
||||
815
|
||||
@@ -20,10 +20,10 @@ jQuery(function($){
|
||||
// 组件
|
||||
slide_links : 'blank', // 个别环节为每张幻灯片(选项:假的,'民','名','空')
|
||||
slides : [ // 幻灯片影像
|
||||
{image : 'https://ecoo.top/alist-histb-com/1.jpg'},
|
||||
{image : 'https://ecoo.top/alist-histb-com/2.jpg'},
|
||||
{image : 'https://ecoo.top/alist-histb-com/3.jpg'},
|
||||
{image : 'https://ecoo.top/alist-histb-com/4.jpg'}
|
||||
{image : 'https://www.ecoo.top/alist-histb-com/1.jpg'},
|
||||
{image : 'https://www.ecoo.top/alist-histb-com/2.jpg'},
|
||||
{image : 'https://www.ecoo.top/alist-histb-com/3.jpg'},
|
||||
{image : 'https://www.ecoo.top/alist-histb-com/4.jpg'}
|
||||
]
|
||||
|
||||
});
|
||||
|
||||
147
static/atfirst.html
Normal file
147
static/atfirst.html
Normal file
@@ -0,0 +1,147 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="description" content="刷机后IP连接">
|
||||
<meta name="keywords" content="海思机顶盒,hi3798m,nas系统,嵌入式系统,ubuntu移植,arm系统">
|
||||
<meta property="og:title" content="www.ecoo.top" />
|
||||
<meta property="og:locale" content="zh-CN" />
|
||||
<meta name="description" content="海思机顶盒,hi3798m,nas系统,嵌入式系统,ubuntu移植,arm系统" />
|
||||
<meta property="og:description" content="海思机顶盒,hi3798m,nas系统,嵌入式系统,ubuntu移植,arm系统" />
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||
<meta property="og:url" content="https://www.ecoo.top/" />
|
||||
<meta property="og:site_name" content="www.ecoo.top" />
|
||||
|
||||
<!--========== BOX ICONS ==========-->
|
||||
<link href='assets/css/boxicons.min.css' rel='stylesheet'>
|
||||
|
||||
<!--========== CSS ==========-->
|
||||
<link rel="stylesheet" href="assets/css/styles.css">
|
||||
|
||||
<title>刷机成功后第一步</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!--========== SCROLL TOP ==========-->
|
||||
<a href="#" class="scrolltop" id="scroll-top">
|
||||
<i class='bx bx-chevron-up scrolltop__icon'></i>
|
||||
</a>
|
||||
|
||||
<!--========== HEADER ==========-->
|
||||
<header class="l-header" id="header">
|
||||
<nav class="nav bd-container">
|
||||
<a href="https://www.ecoo.top" class="nav__logo">e 酷网</a>
|
||||
|
||||
<div class="nav__menu" id="nav-menu">
|
||||
<ul class="nav__list">
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#home" class="nav__link active-link">首页</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#about" class="nav__link">介绍</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#services" class="nav__link">固件下载</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#menu" class="nav__link">教程</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#contact" class="nav__link">协助</a></li>
|
||||
<!-- <li class="nav__item"><a href="https://bbs.histb.com" class="nav__link">社区</a></li> -->
|
||||
|
||||
<li><i class='bx bx-moon change-theme' id="theme-button"></i></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="nav__toggle" id="nav-toggle">
|
||||
<i class='bx bx-menu'></i>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main class="l-main">
|
||||
<section class="menu section bd-container" id="menu">
|
||||
<span class="section-subtitle">保姆级小白教程</span>
|
||||
<h2 class="section-title">刷机成功后第一步做什么 ?</h2>
|
||||
<p class="footer__logo">一、仔细阅读附带在首页的《使用指南》</p>
|
||||
<br><img src="assets/img/shiyongzhinan.png" >
|
||||
<br>
|
||||
<br>
|
||||
<p class="footer__logo">二、登陆后台终端</p>
|
||||
<br><img src="assets/img/login.png" >
|
||||
<br>注意:20220808版之前的,默认密码是1234
|
||||
<br>
|
||||
<p class="footer__logo">三、修改用户密码</p>
|
||||
<br><pre>
|
||||
root@hi3798mv200:~# passwd root
|
||||
New password:
|
||||
Retype new password:
|
||||
passwd: password updated successfully
|
||||
root@hi3798mv200:~# passwd ubuntu
|
||||
New password:
|
||||
Retype new password:
|
||||
passwd: password updated successfully
|
||||
root@hi3798mv200:~#
|
||||
</pre>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<p class="footer__logo">四、加入作者微信群</p>
|
||||
<br>作者微信号“ teasiu ” ,定期拉入群。
|
||||
<br>
|
||||
<br>
|
||||
<p class="footer__logo">五、逛逛用户社区</p>
|
||||
<br><a href="https://bbs.histb.com">交流社区</a>
|
||||
<br>
|
||||
<br><a href="https://doc.ecoo.top/">海纳思使用手册</a>
|
||||
<br>
|
||||
<br>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!--========== FOOTER ==========-->
|
||||
<footer class="footer section bd-container">
|
||||
<div class="footer__container bd-grid">
|
||||
<div class="footer__content">
|
||||
<a href="#" class="footer__logo">海思机顶盒NAS系统</a>
|
||||
<span class="footer__description">一个极低功耗的服务器</span>
|
||||
<div>
|
||||
<a href="#" class="footer__social"><i class='bx bxl-facebook'></i></a>
|
||||
<a href="#" class="footer__social"><i class='bx bxl-instagram'></i></a>
|
||||
<a href="#" class="footer__social"><i class='bx bxl-twitter'></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer__content">
|
||||
<h3 class="footer__title">服务</h3>
|
||||
<ul>
|
||||
<li><a href="#" class="footer__link">盒子硬件购买</a></li>
|
||||
<li><a href="#" class="footer__link">远程刷机</a></li>
|
||||
<li><a href="#" class="footer__link">系统定制</a></li>
|
||||
<li><a href="#" class="footer__link">疑难解决</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer__content">
|
||||
<h3 class="footer__title">链接站点</h3>
|
||||
<ul>
|
||||
<li><a href="https://bbs.histb.com" class="footer__link">交流社区</a></li>
|
||||
<li><a href="https://dl.ecoo.top" class="footer__link">固件下载</a></li>
|
||||
<li><a href="https://demo.ecoo.top" class="footer__link">使用指南</a></li>
|
||||
<li><a href="#" class="footer__link">团队合作</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer__content">
|
||||
<h3 class="footer__title">宗旨</h3>
|
||||
<ul>
|
||||
<li>自由,免费的软件</li>
|
||||
<li>简单,易用的UI界面</li>
|
||||
<li>成本低廉的硬件</li>
|
||||
<li>适配更多芯片和机型</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="footer__copy">© <a href="http://beian.miit.gov.cn">粤ICP备2022054080号</a></p>
|
||||
</footer>
|
||||
|
||||
<!--========== SCROLL REVEAL ==========-->
|
||||
<script src="assets/scrollreveal"></script>
|
||||
|
||||
<!--========== MAIN JS ==========-->
|
||||
<script src="assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
BIN
static/bj.jpg
Normal file
BIN
static/bj.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
BIN
static/favicon.ico
Normal file
BIN
static/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
153
static/findip.html
Normal file
153
static/findip.html
Normal file
@@ -0,0 +1,153 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="description" content="刷机后IP连接">
|
||||
<meta name="keywords" content="海思机顶盒,hi3798m,nas系统,嵌入式系统,ubuntu移植,arm系统">
|
||||
<meta property="og:title" content="www.ecoo.top" />
|
||||
<meta property="og:locale" content="zh-CN" />
|
||||
<meta name="description" content="海思机顶盒,hi3798m,nas系统,嵌入式系统,ubuntu移植,arm系统" />
|
||||
<meta property="og:description" content="海思机顶盒,hi3798m,nas系统,嵌入式系统,ubuntu移植,arm系统" />
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||
<meta property="og:url" content="https://www.ecoo.top/" />
|
||||
<meta property="og:site_name" content="www.ecoo.top" />
|
||||
<meta name="baidu-site-verification" content="code-8FArC3guPw" />
|
||||
<meta name="360-site-verification" content="***************" />
|
||||
|
||||
<!--========== BOX ICONS ==========-->
|
||||
<link href='assets/css/boxicons.min.css' rel='stylesheet'>
|
||||
|
||||
<!--========== CSS ==========-->
|
||||
<link rel="stylesheet" href="assets/css/styles.css">
|
||||
|
||||
<title>刷机后IP连接</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!--========== SCROLL TOP ==========-->
|
||||
<a href="#" class="scrolltop" id="scroll-top">
|
||||
<i class='bx bx-chevron-up scrolltop__icon'></i>
|
||||
</a>
|
||||
|
||||
<!--========== HEADER ==========-->
|
||||
<header class="l-header" id="header">
|
||||
<nav class="nav bd-container">
|
||||
<a href="https://www.ecoo.top" class="nav__logo">e 酷网</a>
|
||||
|
||||
<div class="nav__menu" id="nav-menu">
|
||||
<ul class="nav__list">
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#home" class="nav__link active-link">首页</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#about" class="nav__link">介绍</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#services" class="nav__link">固件下载</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#menu" class="nav__link">教程</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#contact" class="nav__link">协助</a></li>
|
||||
<!-- <li class="nav__item"><a href="https://bbs.histb.com" class="nav__link">社区</a></li> -->
|
||||
|
||||
<li><i class='bx bx-moon change-theme' id="theme-button"></i></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="nav__toggle" id="nav-toggle">
|
||||
<i class='bx bx-menu'></i>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main class="l-main">
|
||||
<section class="menu section bd-container" id="menu">
|
||||
<span class="section-subtitle">保姆级小白教程</span>
|
||||
<h2 class="section-title">为何刷机成功后,我找不到 IP ?</h2>
|
||||
<p class="footer__logo">一、没有等待初始化结束匆匆进行其它操作</p>
|
||||
<br>成功烧写后,会出现“我是小盒子也是大世界”的静止画面;
|
||||
<br>一般5分钟左右会烧写完毕;
|
||||
<br>这个时候,盒子在进行固件系统的初始化,大概需要3分钟初始化系统,初始化结束后会再次自动重启;
|
||||
<br>在这个时间段里,请保持网线连接到路由器,并静静等待。
|
||||
<br>也可以打开路由器的管理页面,找到客户端列表,尝试刷新列表,找到分配给盒子的IP。
|
||||
<br>
|
||||
<br>如果你匆忙操作盒子比如串口连接,比如断电,比如拔插设备等,都可能破坏初始化的过程,
|
||||
<br>造成破坏就必须重新再刷一遍。
|
||||
<br>
|
||||
<br>
|
||||
<p class="footer__logo">二、网线不规范或者网口松动</p>
|
||||
|
||||
<br>仔细检查是否插好网线,建议插好网线来进行刷机。
|
||||
<br>检查是否插在路由器的LAN口,或者LAN口出来的交换机;
|
||||
<br>检查路由器LAN口或交换机LAN口是否亮灯。
|
||||
<br>
|
||||
<br>
|
||||
<p class="footer__logo">三、刷机文件不完整或者被破环</p>
|
||||
<br>有极个别的情况下刷机文件不完整,会造成最后那个分区的系统初始化失败。
|
||||
<br>造成后面无法正常启动系统,需要重新下载整理好刷机文件再刷一次。
|
||||
<br>
|
||||
<br>
|
||||
<p class="footer__logo">四、路由器的功能或设置受到延时或阻碍</p>
|
||||
<br>路由器设置了大量黑名单白名单;
|
||||
<br>路由器缓存IP地址池无法及时更新;
|
||||
<br>路由器的某些功能阻碍IP更新;
|
||||
<br>强烈建议不要插在光猫上,甚至有些人插错在iptv口。
|
||||
<br>甚至有人插在静态IP的旁路由下,无法获取上级路由的DHCP分配。
|
||||
<br>
|
||||
<br>
|
||||
<p class="footer__logo">五、检查是否和电脑在同一个内网IP段</p>
|
||||
<br>同一IP段下,不会理解可以百度,这里不再累赘。
|
||||
<br>
|
||||
<br>
|
||||
<br>最后,上述办法都不行,只能判断盒子硬件问题了。
|
||||
<br>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!--========== FOOTER ==========-->
|
||||
<footer class="footer section bd-container">
|
||||
<div class="footer__container bd-grid">
|
||||
<div class="footer__content">
|
||||
<a href="#" class="footer__logo">海思机顶盒NAS系统</a>
|
||||
<span class="footer__description">一个极低功耗的服务器</span>
|
||||
<div>
|
||||
<a href="#" class="footer__social"><i class='bx bxl-facebook'></i></a>
|
||||
<a href="#" class="footer__social"><i class='bx bxl-instagram'></i></a>
|
||||
<a href="#" class="footer__social"><i class='bx bxl-twitter'></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer__content">
|
||||
<h3 class="footer__title">服务</h3>
|
||||
<ul>
|
||||
<li><a href="#" class="footer__link">盒子硬件购买</a></li>
|
||||
<li><a href="#" class="footer__link">远程刷机</a></li>
|
||||
<li><a href="#" class="footer__link">系统定制</a></li>
|
||||
<li><a href="#" class="footer__link">疑难解决</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer__content">
|
||||
<h3 class="footer__title">链接站点</h3>
|
||||
<ul>
|
||||
<li><a href="https://bbs.histb.com" class="footer__link">交流社区</a></li>
|
||||
<li><a href="https://dl.ecoo.top" class="footer__link">固件下载</a></li>
|
||||
<li><a href="https://demo.ecoo.top" class="footer__link">使用指南</a></li>
|
||||
<li><a href="#" class="footer__link">团队合作</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer__content">
|
||||
<h3 class="footer__title">宗旨</h3>
|
||||
<ul>
|
||||
<li>自由,免费的软件</li>
|
||||
<li>简单,易用的UI界面</li>
|
||||
<li>成本低廉的硬件</li>
|
||||
<li>适配更多芯片和机型</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="footer__copy">© <a href="http://beian.miit.gov.cn">粤ICP备2022054080号</a></p>
|
||||
</footer>
|
||||
|
||||
<!--========== SCROLL REVEAL ==========-->
|
||||
<script src="assets/scrollreveal"></script>
|
||||
|
||||
<!--========== MAIN JS ==========-->
|
||||
<script src="assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
152
static/flashstyle.html
Normal file
152
static/flashstyle.html
Normal file
@@ -0,0 +1,152 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="description" content="选择哪种方式刷入海思设备">
|
||||
<meta name="keywords" content="海思机顶盒,hi3798m,nas系统,嵌入式系统,ubuntu移植,arm系统">
|
||||
<meta property="og:title" content="www.ecoo.top" />
|
||||
<meta property="og:locale" content="zh-CN" />
|
||||
<meta name="description" content="海思机顶盒,hi3798m,nas系统,嵌入式系统,ubuntu移植,arm系统" />
|
||||
<meta property="og:description" content="海思机顶盒,hi3798m,nas系统,嵌入式系统,ubuntu移植,arm系统" />
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||
<meta property="og:url" content="https://www.ecoo.top/" />
|
||||
<meta property="og:site_name" content="www.ecoo.top" />
|
||||
<meta name="baidu-site-verification" content="code-8FArC3guPw" />
|
||||
<meta name="360-site-verification" content="***************" />
|
||||
|
||||
<!--========== BOX ICONS ==========-->
|
||||
<link href='assets/css/boxicons.min.css' rel='stylesheet'>
|
||||
|
||||
<!--========== CSS ==========-->
|
||||
<link rel="stylesheet" href="assets/css/styles.css">
|
||||
|
||||
<title>选择哪种方式刷入海思设备</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!--========== SCROLL TOP ==========-->
|
||||
<a href="#" class="scrolltop" id="scroll-top">
|
||||
<i class='bx bx-chevron-up scrolltop__icon'></i>
|
||||
</a>
|
||||
|
||||
<!--========== HEADER ==========-->
|
||||
<header class="l-header" id="header">
|
||||
<nav class="nav bd-container">
|
||||
<a href="https://www.ecoo.top" class="nav__logo">e 酷网</a>
|
||||
|
||||
<div class="nav__menu" id="nav-menu">
|
||||
<ul class="nav__list">
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#home" class="nav__link active-link">首页</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#about" class="nav__link">介绍</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#services" class="nav__link">固件下载</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#menu" class="nav__link">教程</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#contact" class="nav__link">协助</a></li>
|
||||
<!-- <li class="nav__item"><a href="https://bbs.histb.com" class="nav__link">社区</a></li> -->
|
||||
|
||||
<li><i class='bx bx-moon change-theme' id="theme-button"></i></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="nav__toggle" id="nav-toggle">
|
||||
<i class='bx bx-menu'></i>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main class="l-main">
|
||||
<section class="menu section bd-container" id="menu">
|
||||
<span class="section-subtitle">保姆级小白教程</span>
|
||||
<h2 class="section-title">我应该选择哪种刷机方式?各有什么不同 ?</h2>
|
||||
<p class="footer__logo">一、使用TTL转USB小板连接设备,Hitool工具烧写固件</p>
|
||||
<br>通过 Hitool 工具,连接板子的 GND,TX,RX 和电脑的串口进行固件烧写。
|
||||
<br>这种烧写方法最安全和最方便检测板子和系统固件的状态,
|
||||
<br>通过Hitool工具既能烧写新固件,又能备份原来的安卓系统,既能检测板子的状态,又能掌握烧写过程中的错误;
|
||||
<br>既能擦除emmc存储芯片,还能制作烧片器进行全盘的烧写工作。
|
||||
<br>当你进行固件的修改和开发时,这是必不可少的工具和烧写方法。
|
||||
<br>但是需要一定的动手能力,需要拆机和焊接 TTL 串口。有些时候甚至需要对厂家设置的障碍做飞线和增加贴片等处理。
|
||||
<br>详情请参考<a href="hitool.html" target="_blank">TTL线刷教程</a>。
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<p class="footer__logo">二、短接板子的专用短接电路,或Hi3798MV100短接CPU右上角的1,2脚</p>
|
||||
|
||||
<br>利用短接板子关键位置电路,进入读取 usb 磁盘文件fastboot.bin启动状态进行固件刷入。
|
||||
<br>这种方法比较适合小白,但前提是必须清楚的获得板子的<a href="getreg.html" target="_blank"> reg 管脚配置表名称</a>,并对应下载该固件,配合 usb 磁盘刷入 NAS 系统。
|
||||
<br>原理:
|
||||
<br>短接后,板子的电路启动后,从原来的寻址emmc存储启动,变为寻址usb存储设备启动。
|
||||
<br>usb存储设备必须是fat16或者fat32的文件格式;usb存储设备中必须有启动文件fastboot.bin
|
||||
<br>当然,利用hitool工具擦除emmc第一分区头部的扇区也能达到相同的短接电路的效果。
|
||||
<br>详情请看<a href="usbflash/usbflash.html" target="_blank">U盘短接卡刷教程</a>。
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<p class="footer__logo">三、利用安卓系统的后台终端命令烧写</p>
|
||||
<br>机智的利用前面两种方法的原理,免拆盖子,免短接,免TTL线,
|
||||
<br>利用安卓系统的后台linux终端的命令,将制作的烧片器文件dd克隆进去覆盖整片emmc。
|
||||
<br>前提:
|
||||
<br>你必须破解这个盒子原来的安卓系统,或者按照网上的教程,刷入一个破解的安卓系统,
|
||||
<br>使用adb shell或者telnet能够登录安卓后台终端。
|
||||
<br>这些安卓的破解教程或者adb工具网上有很多,应该还是大部分能找到的。
|
||||
<br>就是稍微有点折腾,没有前面两种方法来的干脆。
|
||||
<br>如果前面两种办法尝试无果的话,这个办法也很香。
|
||||
<br>详情请看<a href="adbflash/adbflash.html" target="_blank"> ADB 刷机教程</a>。
|
||||
<br>
|
||||
<br>
|
||||
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!--========== FOOTER ==========-->
|
||||
<footer class="footer section bd-container">
|
||||
<div class="footer__container bd-grid">
|
||||
<div class="footer__content">
|
||||
<a href="#" class="footer__logo">海思机顶盒NAS系统</a>
|
||||
<span class="footer__description">一个极低功耗的服务器</span>
|
||||
<div>
|
||||
<a href="#" class="footer__social"><i class='bx bxl-facebook'></i></a>
|
||||
<a href="#" class="footer__social"><i class='bx bxl-instagram'></i></a>
|
||||
<a href="#" class="footer__social"><i class='bx bxl-twitter'></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer__content">
|
||||
<h3 class="footer__title">服务</h3>
|
||||
<ul>
|
||||
<li><a href="#" class="footer__link">盒子硬件购买</a></li>
|
||||
<li><a href="#" class="footer__link">远程刷机</a></li>
|
||||
<li><a href="#" class="footer__link">系统定制</a></li>
|
||||
<li><a href="#" class="footer__link">疑难解决</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer__content">
|
||||
<h3 class="footer__title">链接站点</h3>
|
||||
<ul>
|
||||
<li><a href="https://bbs.histb.com" class="footer__link">交流社区</a></li>
|
||||
<li><a href="https://dl.ecoo.top" class="footer__link">固件下载</a></li>
|
||||
<li><a href="https://demo.ecoo.top" class="footer__link">使用指南</a></li>
|
||||
<li><a href="#" class="footer__link">团队合作</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer__content">
|
||||
<h3 class="footer__title">宗旨</h3>
|
||||
<ul>
|
||||
<li>自由,免费的软件</li>
|
||||
<li>简单,易用的UI界面</li>
|
||||
<li>成本低廉的硬件</li>
|
||||
<li>适配更多芯片和机型</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="footer__copy">© <a href="http://beian.miit.gov.cn">粤ICP备2022054080号</a></p>
|
||||
</footer>
|
||||
|
||||
<!--========== SCROLL REVEAL ==========-->
|
||||
<script src="assets/scrollreveal"></script>
|
||||
|
||||
<!--========== MAIN JS ==========-->
|
||||
<script src="assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
154
static/getreg.html
Normal file
154
static/getreg.html
Normal file
@@ -0,0 +1,154 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="description" content="如何获得海思设备reg名称">
|
||||
<meta name="keywords" content="海思机顶盒,hi3798m,nas系统,嵌入式系统,ubuntu移植,arm系统">
|
||||
<meta property="og:title" content="www.ecoo.top" />
|
||||
<meta property="og:locale" content="zh-CN" />
|
||||
<meta name="description" content="海思机顶盒,hi3798m,nas系统,嵌入式系统,ubuntu移植,arm系统" />
|
||||
<meta property="og:description" content="海思机顶盒,hi3798m,nas系统,嵌入式系统,ubuntu移植,arm系统" />
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||
<meta property="og:url" content="https://www.ecoo.top/" />
|
||||
<meta property="og:site_name" content="www.ecoo.top" />
|
||||
<meta name="baidu-site-verification" content="code-8FArC3guPw" />
|
||||
<meta name="360-site-verification" content="***************" />
|
||||
|
||||
<!--========== BOX ICONS ==========-->
|
||||
<link href='assets/css/boxicons.min.css' rel='stylesheet'>
|
||||
|
||||
<!--========== CSS ==========-->
|
||||
<link rel="stylesheet" href="assets/css/styles.css">
|
||||
|
||||
<title>如何获得海思设备reg名称</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!--========== SCROLL TOP ==========-->
|
||||
<a href="#" class="scrolltop" id="scroll-top">
|
||||
<i class='bx bx-chevron-up scrolltop__icon'></i>
|
||||
</a>
|
||||
|
||||
<!--========== HEADER ==========-->
|
||||
<header class="l-header" id="header">
|
||||
<nav class="nav bd-container">
|
||||
<a href="https://www.ecoo.top" class="nav__logo">e 酷网</a>
|
||||
|
||||
<div class="nav__menu" id="nav-menu">
|
||||
<ul class="nav__list">
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#home" class="nav__link active-link">首页</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#about" class="nav__link">介绍</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#services" class="nav__link">固件下载</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#menu" class="nav__link">教程</a></li>
|
||||
<li class="nav__item"><a href="https://www.ecoo.top/#contact" class="nav__link">协助</a></li>
|
||||
<!-- <li class="nav__item"><a href="https://bbs.histb.com" class="nav__link">社区</a></li> -->
|
||||
|
||||
<li><i class='bx bx-moon change-theme' id="theme-button"></i></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="nav__toggle" id="nav-toggle">
|
||||
<i class='bx bx-menu'></i>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main class="l-main">
|
||||
<section class="menu section bd-container" id="menu">
|
||||
<span class="section-subtitle">保姆级小白教程</span>
|
||||
<h2 class="section-title">如何获得海思机顶盒设备 reg 名称</h2>
|
||||
<p class="footer__logo">一、什么叫做 reg 名称</p>
|
||||
reg 是海思 SDK 里对 fastboot 代码的表格配置文件名称,也叫做“管脚配置表”。
|
||||
<br>表格中的内容全是寄存器的配置,主要涉及单板硬件关键参数说明、PLL、DDR、外设时钟、管脚复用、网口配置等。
|
||||
<br>我们来看两个例子:
|
||||
<br>比如 Hi3798Mv100 (华为悦盒 ec6108v9c 型号)的 reg 名称是:
|
||||
<br>
|
||||
<br>hi3798mdmo1g_hi3798mv100_ddr3_1gbyte_16bitx2_4layers_emmc.reg
|
||||
<br>
|
||||
<br>比如 Hi3798Mv200 (恩兔 n2ns1、n2c)的 reg 名称是:
|
||||
<br>
|
||||
<br>hi3798mv2dmc_hi3798mv200_DDR4-2133_2GB_16bitx2_4layers_emmc.reg
|
||||
<br>
|
||||
<br>我们从上面的名称可以判断这个板子的 CPU、DDR、闪存类型、pbc板层数等信息。
|
||||
<br>这样,我们就可以轻易的对照自己的机顶盒判断选择适合刷入对应的神雕开发固件了。
|
||||
<br>
|
||||
<br>
|
||||
<p class="footer__logo">二、获取 reg 名称的四种常用方法</p>
|
||||
1、利用串口读写器 TTL 读取。或详细参考<a href="hitool.html" target="_blank">TTL线刷教程</a>
|
||||
<br>把 usb转ttl小板插入电脑,用杜邦线和针脚连接到板子的 GDN、TX、RX,
|
||||
<br>使用串口终端跑码读取 fastboot 的参数,如下图:
|
||||
<br><img src="assets/img/hitool-run-reg.png" >
|
||||
<br>
|
||||
<br>2、破解你的盒子安卓系统,adb进去后台,在adb shell终端输入。或详细参考<a href="adbflash/adbflash.html" target="_blank"> ADB 线刷教程</a>
|
||||
<br>
|
||||
<br>cat /dev/block/mmcblk0p1 | grep -a hi3798
|
||||
<br>
|
||||
<br>获得的返回信息包含了你的盒子reg名称
|
||||
<br><img src="adbflash/grepreg.png" >
|
||||
<br>
|
||||
<br>3、找到你曾经可以成功刷入这个机顶盒的安卓包,解压这个包,在里面得到一个fastboot.bin
|
||||
<br>在linux的终端下 cat ./fastboot.bin | grep -a hi3798
|
||||
<br>获得的返回信息包含了你的盒子reg名称。
|
||||
<br>
|
||||
<br>4、参考本站首页的<a href="histb.html" target="_blank"> 设备适配表 </a>。
|
||||
<br>
|
||||
<br>5、在<a href="https://bbs.histb.com" target="_blank"> 交流社区 </a>或群里拍照你的盒子背后的照片,得到其他人的协助。
|
||||
<br>
|
||||
<br>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<!--========== FOOTER ==========-->
|
||||
<footer class="footer section bd-container">
|
||||
<div class="footer__container bd-grid">
|
||||
<div class="footer__content">
|
||||
<a href="#" class="footer__logo">海思机顶盒NAS系统</a>
|
||||
<span class="footer__description">一个极低功耗的服务器</span>
|
||||
<div>
|
||||
<a href="#" class="footer__social"><i class='bx bxl-facebook'></i></a>
|
||||
<a href="#" class="footer__social"><i class='bx bxl-instagram'></i></a>
|
||||
<a href="#" class="footer__social"><i class='bx bxl-twitter'></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer__content">
|
||||
<h3 class="footer__title">服务</h3>
|
||||
<ul>
|
||||
<li><a href="#" class="footer__link">盒子硬件购买</a></li>
|
||||
<li><a href="#" class="footer__link">远程刷机</a></li>
|
||||
<li><a href="#" class="footer__link">系统定制</a></li>
|
||||
<li><a href="#" class="footer__link">疑难解决</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer__content">
|
||||
<h3 class="footer__title">链接站点</h3>
|
||||
<ul>
|
||||
<li><a href="https://bbs.histb.com" class="footer__link">交流社区</a></li>
|
||||
<li><a href="https://dl.ecoo.top" class="footer__link">固件下载</a></li>
|
||||
<li><a href="https://demo.ecoo.top" class="footer__link">使用指南</a></li>
|
||||
<li><a href="#" class="footer__link">团队合作</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="footer__content">
|
||||
<h3 class="footer__title">宗旨</h3>
|
||||
<ul>
|
||||
<li>自由,免费的软件</li>
|
||||
<li>简单,易用的UI界面</li>
|
||||
<li>成本低廉的硬件</li>
|
||||
<li>适配更多芯片和机型</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="footer__copy">© <a href="http://beian.miit.gov.cn">粤ICP备2022054080号</a></p>
|
||||
</footer>
|
||||
|
||||
<!--========== SCROLL REVEAL ==========-->
|
||||
<script src="assets/scrollreveal"></script>
|
||||
|
||||
<!--========== MAIN JS ==========-->
|
||||
<script src="assets/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
100
static/hiop.sh
Executable file
100
static/hiop.sh
Executable file
@@ -0,0 +1,100 @@
|
||||
#!/bin/bash
|
||||
|
||||
ARCH_BIT=$(getconf LONG_BIT)
|
||||
[ "$ARCH_BIT" = "32" ] && ARCH="armhf" || ARCH="arm64"
|
||||
|
||||
dl_url="https://dl.ecoo.top/update/system"
|
||||
declare -a system_versions
|
||||
system_versions=(
|
||||
[1]="海纳思Hi-OpenWrt固件 openwrt-armvirt-${ARCH_BIT}-root.ext4.gz"
|
||||
[2]="海纳思NAS完整版固件 Ubuntu-20.04.5-${ARCH}.gz"
|
||||
)
|
||||
|
||||
readonly COLOUR_RESET='\e[0m'
|
||||
declare -A COLORS
|
||||
COLORS=(
|
||||
["red"]='\e[91m'
|
||||
["green"]='\e[32;1m'
|
||||
["yellow"]='\e[33m'
|
||||
)
|
||||
|
||||
printStr() {
|
||||
color=$1
|
||||
printf ${COLORS[${color}]}"$2"${COLOUR_RESET}"\n"
|
||||
}
|
||||
|
||||
_exit() {
|
||||
exit_singal=$1
|
||||
shift
|
||||
[ "$exit_singal" != "0" ] && printStr red "$*" || printStr green "$*"
|
||||
exit $exit_singal
|
||||
}
|
||||
|
||||
get_md5() {
|
||||
case $1 in
|
||||
-c)
|
||||
shift
|
||||
wget -q $1 -O - | grep $2 | awk '{print $1}'
|
||||
;;
|
||||
-l)
|
||||
shift
|
||||
[ ! -f "$1" ] && return 1
|
||||
md5sum $1 2> /dev/null | awk '{print $1}'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
echo "
|
||||
+----------------------------------------------------------------------
|
||||
| 海纳思hi-op固件切换专用脚本温馨提示:
|
||||
+----------------------------------------------------------------------
|
||||
| 切换后原系统将完全清除,请注意保存资料。
|
||||
+----------------------------------------------------------------------
|
||||
| 如果不确定,请按CTRL+C结束此脚本.
|
||||
+----------------------------------------------------------------------
|
||||
"
|
||||
|
||||
if [ $(whoami) != "root" ];then
|
||||
_exit 1 "请使用root权限切换系统命令!"
|
||||
fi
|
||||
|
||||
#nasversion=`cat /etc/nasversion`
|
||||
#if [ $nasversion != "20230401" ];then
|
||||
# _exit 1 "请使用最新20230401系统!"
|
||||
#fi
|
||||
|
||||
for index in "${!system_versions[@]}"; do
|
||||
printStr green "$index. $(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
done
|
||||
|
||||
while :; do
|
||||
printStr yellow "你想要安装哪个版本? 输入数字后按回车确定:"
|
||||
read version_number
|
||||
for index in "${!system_versions[@]}"; do
|
||||
if [ "$version_number" = "$index" ]; then
|
||||
selected_version="$(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
dlfile="$(echo ${system_versions[$index]}|awk '{print $2}')"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
wget -q --show-progress --no-check-certificate ${dl_url}/${dlfile} -O /tmp/${dlfile} || _exit 1 "下载失败,请重试"
|
||||
[ "$(get_md5 -c ${dl_url}/${dlfile}.md5sum ${dlfile})" != "$(get_md5 -l /tmp/${dlfile})" ] && _exit 1 "文件校验失败,请重试"
|
||||
|
||||
mv /tmp/${dlfile} /tmp/backup-${ARCH_BIT}.gz
|
||||
mkdir -p /tmp/backup
|
||||
mount /dev/mmcblk0p8 /tmp/backup
|
||||
if [ ! -f /tmp/backup/backup-${ARCH_BIT}1.gz ]; then
|
||||
mv /tmp/backup/backup-${ARCH_BIT}.gz /tmp/backup/backup-${ARCH_BIT}1.gz
|
||||
fi
|
||||
mv /tmp/backup-${ARCH_BIT}.gz /tmp/backup
|
||||
sync
|
||||
umount /tmp/backup
|
||||
|
||||
printStr yellow "
|
||||
==============================================================
|
||||
配置已完成,盒子正在重启并准备初始化中,
|
||||
若5分钟后还没有获得ip,请手动重启盒子,并继续稍等初始化结束
|
||||
=============================================================="
|
||||
recoverbackup
|
||||
84
static/hitool.html
Normal file
84
static/hitool.html
Normal file
@@ -0,0 +1,84 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="description" content="海思机顶盒TTL刷机教程">
|
||||
<meta name="keywords" content="海思机顶盒,hi3798m,nas系统,嵌入式系统,ubuntu移植,arm系统">
|
||||
<meta property="og:title" content="www.ecoo.top" />
|
||||
<meta property="og:locale" content="zh-CN" />
|
||||
<meta name="description" content="海思机顶盒,hi3798m,nas系统,嵌入式系统,ubuntu移植,arm系统" />
|
||||
<meta property="og:description" content="海思机顶盒,hi3798m,nas系统,嵌入式系统,ubuntu移植,arm系统" />
|
||||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
|
||||
<meta property="og:url" content="https://www.ecoo.top/" />
|
||||
<meta property="og:site_name" content="www.ecoo.top" />
|
||||
<meta name="baidu-site-verification" content="code-8FArC3guPw" />
|
||||
<title>华为海思刷机工具Hitool使用指南</title>
|
||||
<style>
|
||||
body {
|
||||
width: 80em;
|
||||
margin: 0 auto;
|
||||
font-family: Tahoma, Verdana, Arial, sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2 id="华为海思刷机工具ttl刷机教程">华为海思刷机工具TTL刷机教程</h2>
|
||||
<p>它有另外一个昵称叫“海兔”。
|
||||
本站提供windows和linux版本的下载:</p>
|
||||
<table width="690" border="1">
|
||||
<tr>
|
||||
<td width="62">平台</td>
|
||||
<td width="291">国内高速下载地址</td>
|
||||
<td width="315">备用海外下载地址</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="46">windows</td>
|
||||
<td><a href="https://dl.ecoo.top/HiTool-soft/HiTool-windows.7z">海兔工具windows版</a></td>
|
||||
<td><a href="https://oss.histb.com/HiTool-windows.7z">https://oss.histb.com/HiTool-windows.7z</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="48">linux</td>
|
||||
<td><a href="https://dl.ecoo.top/HiTool-soft/hitool_linux.tar.gz">海兔工具linux版</a></td>
|
||||
<td><a href="https://oss.histb.com/hitool_linux.tar.gz">https://oss.histb.com/hitool_linux.tar.gz</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>使用教程:</p>
|
||||
<p>一.参阅华为官方的pdf文档:<a href="https://oss.histb.com/HiBurn.pdf" title="HiBurn.pdf">HiBurn.pdf</a> 和 <a href="https://oss.histb.com/HiTool.pdf" title="HiTool.pdf">HiTool.pdf</a></p>
|
||||
<p>二.windows版无需安装,解压后打开hitool.exe即可使用。 </p>
|
||||
<p>三.刷入海思机顶盒NAS系统注意事项:</p>
|
||||
<p> (a.)请首先关闭防火墙,杀软等阻拦69端口通讯的设置。</p>
|
||||
<p> (b.)其次严格按照TTL刷机图的几个要点进行配置。</p>
|
||||
<p> (c.)USB-TTL转接板最好用免驱的CH340,淘宝价大约8元左右包邮,含杜邦线和排针。</p>
|
||||
<p><img src="assets/img/ch340.png" alt="">
|
||||
<img src="assets/img/hittol-ttl-line.png" alt=""></p>
|
||||
<p>(d.)只接上GDN,TX,RX三个点即可,瞎接VCC可能会导致烧坏板子。</p>
|
||||
<p> (e.)请使用3.3V的转接器跳线连接。 </p>
|
||||
<p>第1步.TTL跑码以获得机顶盒的芯片(CPU)和元件管脚参数(reg name):或参考<a href="https://www.ecoo.top/getreg.html" title="其它方法获得reg名称">其它方法获得reg名称</a></p>
|
||||
<p><img src="assets/img/hitool-run-reg.png" alt=""></p>
|
||||
<p>第2步.参考神雕开发的设备适配表,查看你的设备需要下载的固件:</p>
|
||||
<p>适配表:<a href="https://www.ecoo.top/histb.html">https://www.ecoo.top/histb.html</a></p>
|
||||
<p>固件下载:<a href="https://dl.ecoo.top">https://dl.ecoo.top</a></p>
|
||||
<p>第3步.根据自己盒子的芯片型号来操作Hitool进行固件烧写:</p>
|
||||
<p><img src="assets/img/hitool-chip.png" alt=""></p>
|
||||
<p><img src="assets/img/hitool-flash.png" alt=""></p>
|
||||
<p>最后:在路由器管理页面,查找路由器自动分配给盒子的IP,浏览器输入IP地址进入盒子首页。</p>
|
||||
<p> 注意: </p>
|
||||
<p>hi3798m默认型号的mac是00:11:22:33:44:55 </p>
|
||||
|
||||
<p>四.常见问题解答</p>
|
||||
<p>1.无法下载fastboot,多数是因为TTL线跟电脑hitool工具之间通讯不良造成的。 </p>
|
||||
<p>检查排针是否牢牢的稳固的插好在板子上, </p>
|
||||
<p>检查杜邦线是否有问题,
|
||||
检查板子的GDN,TX,RX是否正确排序。(TX,RX需要对调) </p>
|
||||
<p>2.端口被占用,请关闭其它使用串口的连接。 </p>
|
||||
<p>3.刷完fastboot,一直停留在TTTT符号,没有接好网线,或者网络不通,或者防火墙没有关闭。 </p>
|
||||
<p>4.fastboot选对了,但是刷不进去,或者刷入失败,检查是否高安板,高安请放弃。
|
||||
检查是否NAND内存,NAND板请放弃。 </p>
|
||||
<p>5.部分盒子由于厂家设置了TTL阻断,需要飞线或者重新加电阻接通才会正常使用。 </p>
|
||||
<p>6.更多疑难问题,请到社区<a href="https://bbs.histb.com" title="bbs.histb.com">bbs.histb.com</a>求助。</p>
|
||||
<p>本文ecoo.top版权所有。</p>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
17
static/index.html
Normal file
17
static/index.html
Normal file
File diff suppressed because one or more lines are too long
34
static/iptv.txt
Normal file
34
static/iptv.txt
Normal file
@@ -0,0 +1,34 @@
|
||||
CCTV-1,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001022/index.m3u8
|
||||
CCTV-2,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001220/index.m3u8
|
||||
CCTV-3,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001186/index.m3u8
|
||||
CCTV-4 中文卫视频道,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001221/index.m3u8
|
||||
CCTV-5 体育,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001187/index.m3u8
|
||||
CCTV-5+ 体育赛事,http://iptvrr.sh.chinamobile.com:6060/yinhe/2/ch00000090990000001334/index.m3u8?virtualDomain=yinhe.live_hls.zte.com
|
||||
CCTV-6 电影,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001188/index.m3u8
|
||||
CCTV-7 国防军事,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001236/index.m3u8
|
||||
CCTV-8 电视剧,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001189/index.m3u8
|
||||
CCTV-9 纪录,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001237/index.m3u8
|
||||
CCTV-10 科教,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001238/index.m3u8
|
||||
CCTV-11 戏曲,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001309/index.m3u8
|
||||
CCTV-12 社会与法,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001239/index.m3u8
|
||||
CCTV-13 新闻,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001328/index.m3u8
|
||||
CCTV-14 少儿,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001240/index.m3u8
|
||||
CCTV-15 音乐,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001338/index.m3u8
|
||||
CCTV-16 奥林匹克,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001258/index.m3u8
|
||||
CCTV-17 农业农村,http://iptvrr.sh.chinamobile.com:6060/cms001/ch00000090990000001241/index.m3u8
|
||||
CCTV1,http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221225804/index.m3u8
|
||||
CCTV2,http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226195/index.m3u8
|
||||
CCTV2,http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226224/index.m3u8
|
||||
CCTV3,http://39.134.24.166/dbiptv.sn.chinamobile.com/PLTV/88888888/224/3221226397/1.m3u8
|
||||
CCTV4,http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226191/index.m3u8
|
||||
CCTV5,http://39.134.24.161/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226395/index.m3u8
|
||||
CCTV5+,http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221225761/index.m3u8
|
||||
CCTV6,http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226393/index.m3u8
|
||||
CCTV7,http://39.134.24.166/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226192/index.m3u8
|
||||
CCTV8,http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226012/index.m3u8
|
||||
CCTV9,http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226197/index.m3u8
|
||||
CCTV10,http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226189/index.m3u8
|
||||
CCTV13,http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226233/index.m3u8
|
||||
CCTV14,http://39.134.24.166/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226193/index.m3u8
|
||||
CCTV15,http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221225785/index.m3u8
|
||||
CCTV16,http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226921/index.m3u8
|
||||
5
static/ms79565163.txt
Normal file
5
static/ms79565163.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"Description": "Microsoft 365 的域所有权验证文件 - 放置在网站根目录中",
|
||||
"Domain": "ecoo.top",
|
||||
"Id": "23d5e5c4-937c-4a7c-8175-5f5b9ad9c12a"
|
||||
}
|
||||
85
static/mv100-bt.sh
Executable file
85
static/mv100-bt.sh
Executable file
@@ -0,0 +1,85 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare -a system_versions
|
||||
system_versions=(
|
||||
[1]='海纳思NAS社区版固件 Ubuntu-20.04.5-armhf.gz'
|
||||
[2]='海纳思宝塔付费专用固件 Ubuntu-bt-armhf.gz'
|
||||
)
|
||||
|
||||
echo "
|
||||
+----------------------------------------------------------------------
|
||||
| 海纳思系统固件切换专用脚本温馨提示:
|
||||
+----------------------------------------------------------------------
|
||||
| 切换后原系统将完全清除,请注意保存资料。
|
||||
+----------------------------------------------------------------------
|
||||
| 如果不确定,请按CTRL+C结束此脚本.
|
||||
+----------------------------------------------------------------------
|
||||
"
|
||||
|
||||
temp_file=$(mktemp)
|
||||
curl -sSL https://hi.ecoo.top/mirror-utils.sh > $temp_file
|
||||
if [ ! -f /etc/public-download.sh ] || [ "$(cat $temp_file|md5sum|awk '{print $1}')" != "$(cat /etc/public-download.sh|md5sum|awk '{print $1}')" ]; then
|
||||
cp $temp_file /etc/public-download.sh
|
||||
fi
|
||||
rm -f $temp_file
|
||||
source /etc/public-download.sh
|
||||
|
||||
if [ $(whoami) != "root" ];then
|
||||
_exit 1 "请使用root权限切换系统命令!"
|
||||
fi
|
||||
|
||||
date_20230818=$(date -d '20230818' +%s)
|
||||
if [ $(date -d $(cat /etc/nasversion) +%s) -lt ${date_20230818} ]; then
|
||||
_exit 1 "请升级到 20230818 或更新的版本后再执行此命令!"
|
||||
fi
|
||||
|
||||
#if [ $(df -T|grep /tmp|awk '{print int($5)}') -lt 358400 ]; then
|
||||
# printStr red "临时目录 /tmp 剩余空间小于350M!"
|
||||
# printStr red "请执行扩容命令并执行 reboot 重启后再执行本升级命令!"
|
||||
# printStr yellow " tmp扩容命令:"
|
||||
# printStr green " sed -i \"s|^tmpfs.*\$|tmpfs /tmp tmpfs defaults,nosuid,size=500M 0 0|g\" /etc/fstab"
|
||||
# _exit 1
|
||||
#fi
|
||||
|
||||
is64bit=$(getconf LONG_BIT)
|
||||
if [ "${is64bit}" != '32' ];then
|
||||
_exit 1 "抱歉, 当前系统切换版本不支持64位系统, 请使用32位系统!";
|
||||
fi
|
||||
|
||||
for index in "${!system_versions[@]}"; do
|
||||
printStr green "$index. $(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
done
|
||||
|
||||
while :; do
|
||||
printStr yellow "你想要安装哪个版本? 输入数字后按回车确定:"
|
||||
read version_number
|
||||
for index in "${!system_versions[@]}"; do
|
||||
if [ "$version_number" = "$index" ]; then
|
||||
selected_version="$(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
dlfile="$(echo ${system_versions[$index]}|awk '{print $2}')"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
printStr yellow "检测并选定下载节点..."
|
||||
get_mirror_url
|
||||
|
||||
rm -rf /tmp/*
|
||||
printStr yellow "下载刷机包..."
|
||||
dl_get update/system/${dlfile} /root/${dlfile}
|
||||
[ "$(get_md5 -c ${NODE_URL}/update/system/${dlfile}.md5sum ${dlfile})" != "$(get_md5 -l /root/${dlfile})" ] && _exit 1 "文件校验失败,请重试"
|
||||
printStr green "正在配置系统,请稍后..."
|
||||
mv /root/${dlfile} /root/backup-32.gz
|
||||
mkdir -p /tmp/backup
|
||||
mount /dev/mmcblk0p8 /tmp/backup
|
||||
mv /root/backup-32.gz /tmp/backup
|
||||
sync
|
||||
umount /tmp/backup
|
||||
|
||||
printStr yellow "
|
||||
==============================================================
|
||||
配置已完成,盒子正在重启并准备初始化中,
|
||||
若5分钟后还没有获得ip,请手动重启盒子,并继续稍等初始化结束
|
||||
=============================================================="
|
||||
recoverbackup -a
|
||||
76
static/mv100-wx.sh
Executable file
76
static/mv100-wx.sh
Executable file
@@ -0,0 +1,76 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare -a system_versions
|
||||
system_versions=(
|
||||
[1]='海思机顶盒网心云专用固件 onething-32.gz'
|
||||
[2]='海纳思系统 Ubuntu-20.04.5-armhf.gz'
|
||||
)
|
||||
|
||||
echo "
|
||||
+----------------------------------------------------------------------
|
||||
| 海纳思系统网心云固件切换专用脚本温馨提示:
|
||||
+----------------------------------------------------------------------
|
||||
| 切换后原系统将完全清除,请注意保存资料。
|
||||
+----------------------------------------------------------------------
|
||||
| 如果不确定,请按CTRL+C结束此脚本.
|
||||
+----------------------------------------------------------------------
|
||||
"
|
||||
|
||||
temp_file=$(mktemp)
|
||||
curl -sSL https://hi.ecoo.top/mirror-utils.sh > $temp_file
|
||||
if [ ! -f /etc/public-download.sh ] || [ "$(cat $temp_file|md5sum|awk '{print $1}')" != "$(cat /etc/public-download.sh|md5sum|awk '{print $1}')" ]; then
|
||||
cp $temp_file /etc/public-download.sh
|
||||
fi
|
||||
rm -f $temp_file
|
||||
source /etc/public-download.sh
|
||||
|
||||
if [ $(whoami) != "root" ];then
|
||||
_exit 1 "请使用root权限切换系统命令!"
|
||||
fi
|
||||
|
||||
#nasversion=`cat /etc/nasversion`
|
||||
#if [ $nasversion != "20230701" ];then
|
||||
# _exit 1 "请使用最新20230701系统!网站公告有升级方法。"
|
||||
#fi
|
||||
|
||||
is64bit=$(getconf LONG_BIT)
|
||||
if [ "${is64bit}" != '32' ];then
|
||||
_exit 1 "抱歉, 当前系统切换版本不支持64位系统, 请使用32位系统!";
|
||||
fi
|
||||
|
||||
for index in "${!system_versions[@]}"; do
|
||||
printStr green "$index. $(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
done
|
||||
|
||||
while :; do
|
||||
printStr yellow "你想要安装哪个版本? 输入数字后按回车确定:"
|
||||
read version_number
|
||||
for index in "${!system_versions[@]}"; do
|
||||
if [ "$version_number" = "$index" ]; then
|
||||
selected_version="$(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
dlfile="$(echo ${system_versions[$index]}|awk '{print $2}')"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
printStr yellow "检测并选定下载节点..."
|
||||
get_mirror_url
|
||||
|
||||
printStr yellow "下载刷机包..."
|
||||
dl_get update/system/${dlfile} /root/${dlfile}
|
||||
[ "$(get_md5 -c ${NODE_URL}/update/system/${dlfile}.md5sum ${dlfile})" != "$(get_md5 -l /root/${dlfile})" ] && _exit 1 "文件校验失败,请重试"
|
||||
|
||||
mv /root/${dlfile} /root/backup-32.gz
|
||||
mkdir -p /root/backup
|
||||
mount /dev/mmcblk0p8 /root/backup
|
||||
mv /root/backup-32.gz /root/backup
|
||||
sync
|
||||
umount /root/backup
|
||||
|
||||
printStr yellow "
|
||||
==============================================================
|
||||
配置已完成,盒子正在重启并准备初始化中,
|
||||
若5分钟后还没有获得ip,请手动重启盒子,并继续稍等初始化结束
|
||||
=============================================================="
|
||||
recoverbackup -a
|
||||
65
static/mv100_upgrade.sh
Executable file
65
static/mv100_upgrade.sh
Executable file
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
|
||||
dlfile="mv100-99.flash.gz"
|
||||
|
||||
echo "
|
||||
+----------------------------------------------------------------------
|
||||
| 海纳思系统hi3798mv100升级系统专用脚本温馨提示:
|
||||
+----------------------------------------------------------------------
|
||||
| 此专用脚本可以让你在任意版本的NAS系统下一键升级到20240201,
|
||||
+----------------------------------------------------------------------
|
||||
| 升级20240201版专用,原系统将完全清除,请注意保存资料。
|
||||
+----------------------------------------------------------------------
|
||||
| 如果不确定,请按CTRL+C结束此脚本.
|
||||
+----------------------------------------------------------------------
|
||||
"
|
||||
read -p "继续执行?[y/n]: " result
|
||||
[ "${result^^}" != "Y" ] && exit
|
||||
|
||||
temp_file=$(mktemp)
|
||||
curl -sSL https://hi.ecoo.top/mirror-utils.sh > $temp_file
|
||||
if [ ! -f /etc/public-download.sh ] || [ "$(cat $temp_file|md5sum|awk '{print $1}')" != "$(cat /etc/public-download.sh|md5sum|awk '{print $1}')" ]; then
|
||||
cp $temp_file /etc/public-download.sh
|
||||
fi
|
||||
rm -f $temp_file
|
||||
source /etc/public-download.sh
|
||||
|
||||
if [ $(whoami) != "root" ];then
|
||||
_exit 1 "请使用root权限切换用户!"
|
||||
fi
|
||||
|
||||
model=$(cpuid)
|
||||
platform=hi3798mv100
|
||||
|
||||
if [ "$(echo ${model})" != "$platform" ];then
|
||||
_exit 1 "本升级程序仅支持${platform}机型!"
|
||||
fi
|
||||
|
||||
promode=$(uname -r|cut -c 13-)
|
||||
if [ $promode = 16010066 ];then
|
||||
_exit 1 "专业版用户请使用vipupgrade命令进行升级!"
|
||||
fi
|
||||
|
||||
space_left=$(df -hT|grep /dev/root|awk '{print $4}')
|
||||
if [ "$(expr $(echo ${space_left%%G}) \> 1)" != 1 ];then
|
||||
_exit 1 "请确保剩余空间大于1G!"
|
||||
fi
|
||||
|
||||
printStr yellow "检测并选定下载节点..."
|
||||
get_mirror_url
|
||||
|
||||
printStr yellow "下载刷机包..."
|
||||
dl_get update/system/${dlfile} /${dlfile}
|
||||
printStr yellow "校验刷机包..."
|
||||
echo "${NODE_URL}/update/system/${dlfile}.md5sum"
|
||||
[ "$(get_md5 -c ${NODE_URL}/update/system/${dlfile}.md5sum ${dlfile})" != "$(get_md5 -l /${dlfile})" ] && _exit 1 "文件校验失败,请重试"
|
||||
printStr green "下载完成!"
|
||||
|
||||
printStr yellow "刷机中,请勿断电..."
|
||||
gunzip -c /${dlfile} | dd of=/dev/mmcblk0 bs=1024 seek=1024 status=progress conv=sync
|
||||
|
||||
[[ $? == 0 ]] && printStr yellow "
|
||||
==============================================================
|
||||
恭喜刷机已完成,系统重启中,待初始化5-8分钟结束后即可登录。
|
||||
==============================================================" && reboot || \
|
||||
_exit 1 "刷机失败"
|
||||
80
static/mv200_upgrade.sh
Executable file
80
static/mv200_upgrade.sh
Executable file
@@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f /sys/firmware/devicetree/base/my_board_info/custom_id ];then
|
||||
custom_id=$(tr -d '\0' < /sys/firmware/devicetree/base/my_board_info/custom_id)
|
||||
if [ "${custom_id}" = "n2ns1" ];then
|
||||
dlfile="n2-99.flash.gz"
|
||||
fi
|
||||
else
|
||||
dlfile="mv200-99.flash.gz"
|
||||
fi
|
||||
|
||||
echo "
|
||||
+----------------------------------------------------------------------
|
||||
| 海纳思系统hi3798mv200升级系统专用脚本温馨提示:
|
||||
+----------------------------------------------------------------------
|
||||
| 此专用脚本可以让你在任意版本的NAS系统下一键升级到20240201,
|
||||
+----------------------------------------------------------------------
|
||||
| 升级20240201版专用,原系统将完全清除,请注意保存资料。
|
||||
+----------------------------------------------------------------------
|
||||
| 如果不确定,请按CTRL+C结束此脚本.
|
||||
+----------------------------------------------------------------------
|
||||
"
|
||||
read -p "继续执行?[y/n]: " result
|
||||
[ "${result^^}" != "Y" ] && exit
|
||||
|
||||
temp_file=$(mktemp)
|
||||
curl -sSL https://hi.ecoo.top/mirror-utils.sh > $temp_file
|
||||
if [ ! -f /etc/public-download.sh ] || [ "$(cat $temp_file|md5sum|awk '{print $1}')" != "$(cat /etc/public-download.sh|md5sum|awk '{print $1}')" ]; then
|
||||
cp $temp_file /etc/public-download.sh
|
||||
fi
|
||||
rm -f $temp_file
|
||||
source /etc/public-download.sh
|
||||
|
||||
model=$(cpuid)
|
||||
platform=hi3798mv200
|
||||
|
||||
if [ "$(echo ${model})" != "$platform" ];then
|
||||
_exit 1 "本升级程序仅支持${platform}机型!"
|
||||
fi
|
||||
|
||||
if [ $(whoami) != "root" ];then
|
||||
_exit 1 "请使用root权限切换系统命令!"
|
||||
fi
|
||||
|
||||
is64bit=$(getconf LONG_BIT)
|
||||
if [ "${is64bit}" != '64' ];then
|
||||
_exit 1 "抱歉, 当前系统切换版本不支持32位系统, 请使用64位系统!";
|
||||
fi
|
||||
promode=$(uname -r|cut -c 13-)
|
||||
if [ $promode = 26010066 ];then
|
||||
_exit 1 "专业版用户请使用vipupgrade命令进行升级!"
|
||||
fi
|
||||
#nasversion=`cat /etc/nasversion`
|
||||
#if [ $nasversion = "20230101" ];then
|
||||
# _exit 1 "已经是20230101最新版,无需升级系统!"
|
||||
#fi
|
||||
|
||||
space_left=$(df -hT|grep /dev/root|awk '{print $4}')
|
||||
if [ "$(expr $(echo ${space_left%%G}) \> 1)" != 1 ];then
|
||||
_exit 1 "请确保剩余空间大于1G!"
|
||||
fi
|
||||
|
||||
printStr yellow "检测并选定下载节点..."
|
||||
get_mirror_url
|
||||
|
||||
printStr yellow "下载刷机包..."
|
||||
dl_get update/system/${dlfile} /${dlfile}
|
||||
printStr yellow "校验刷机包..."
|
||||
[ "$(get_md5 -c ${NODE_URL}/update/system/${dlfile}.md5sum ${dlfile})" != "$(get_md5 -l /${dlfile})" ] && _exit 1 "文件校验失败,请重试"
|
||||
printStr green "下载完成!"
|
||||
|
||||
printStr yellow "刷机中,请勿断电..."
|
||||
gunzip -c /${dlfile} | dd of=/dev/mmcblk0 bs=1024 seek=1024 status=progress conv=sync
|
||||
|
||||
[[ $? == 0 ]] && printStr yellow "
|
||||
==============================================================
|
||||
刷机已完成,请手工关闭电源并再次开启,等待初始化5-8分钟即可。
|
||||
==============================================================" && reboot || \
|
||||
_exit 1 "刷机失败"
|
||||
|
||||
134
static/mv23-basic.sh
Executable file
134
static/mv23-basic.sh
Executable file
@@ -0,0 +1,134 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare -A dl_mirrors
|
||||
dl_mirrors=(
|
||||
["neimeng"]="https://node.histb.com:9088/update/system"
|
||||
["hunan"]="https://node3.histb.com:9088/update/system"
|
||||
["hongkong"]="https://node2.histb.com/update/system"
|
||||
["dl"]="https://dl.ecoo.top/update/system"
|
||||
)
|
||||
|
||||
declare -a system_versions
|
||||
system_versions=(
|
||||
[1]='海纳思NAS社区版固件 Ubuntu-20.04.5-arm64.gz'
|
||||
[2]='海纳思纯净版固件 basic-hinas-64.gz'
|
||||
)
|
||||
|
||||
readonly COLOUR_RESET='\e[0m'
|
||||
declare -A COLORS
|
||||
COLORS=(
|
||||
["red"]='\e[91m'
|
||||
["green"]='\e[32;1m'
|
||||
["yellow"]='\e[33m'
|
||||
)
|
||||
|
||||
printStr() {
|
||||
color=$1
|
||||
printf ${COLORS[${color}]}"$2"${COLOUR_RESET}"\n"
|
||||
}
|
||||
|
||||
_exit() {
|
||||
exit_singal=$1
|
||||
shift
|
||||
[ "$exit_singal" != "0" ] && printStr red "$*" || printStr green "$*"
|
||||
exit $exit_singal
|
||||
}
|
||||
|
||||
get_mirror_url() {
|
||||
tmp_file=/dev/shm/net_test.pl
|
||||
[ -f "${tmp_file}" ] && rm -f ${tmp_file}
|
||||
touch $tmp_file
|
||||
|
||||
for mirror_name in ${!dl_mirrors[*]}; do
|
||||
mirror_url=${dl_mirrors[$mirror_name]}
|
||||
NODE_CHECK=$(curl -k -L --connect-timeout 3 -m 3 2>/dev/null -w "%{http_code} %{time_total}" ${mirror_url}/net_test|xargs)
|
||||
NODE_STATUS=$(echo ${NODE_CHECK}|awk '{print $2}')
|
||||
TIME_TOTAL=$(echo ${NODE_CHECK}|awk '{print $3 * 1000 }'|cut -d '.' -f 1)
|
||||
if [ "${NODE_STATUS}" == "200" ];then
|
||||
echo "$TIME_TOTAL $mirror_name $mirror_url" >> $tmp_file
|
||||
fi
|
||||
done
|
||||
|
||||
NODE_NAME=$(cat $tmp_file|sort -g -t " " -k 1|head -n 1|awk '{print $2}')
|
||||
NODE_URL=$(cat $tmp_file|sort -g -t " " -k 1|head -n 1|awk '{print $3}')
|
||||
printStr green "using mirror: $NODE_NAME"
|
||||
rm -f $tmp_file
|
||||
}
|
||||
|
||||
get_md5() {
|
||||
case $1 in
|
||||
-c)
|
||||
shift
|
||||
wget -4 -q --no-check-certificate $1 -O - | grep $2 | awk '{print $1}'
|
||||
;;
|
||||
-l)
|
||||
shift
|
||||
[ ! -f "$1" ] && return 1
|
||||
md5sum $1 2> /dev/null | awk '{print $1}'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
echo "
|
||||
+----------------------------------------------------------------------
|
||||
| 海纳思系统固件切换专用脚本温馨提示:
|
||||
+----------------------------------------------------------------------
|
||||
| 切换后原系统将完全清除,请注意保存资料。
|
||||
+----------------------------------------------------------------------
|
||||
| 如果不确定,请按CTRL+C结束此脚本.
|
||||
+----------------------------------------------------------------------
|
||||
"
|
||||
|
||||
if [ $(whoami) != "root" ];then
|
||||
_exit 1 "请使用root权限切换系统命令!"
|
||||
fi
|
||||
|
||||
date_20230818=$(date -d '20230818' +%s)
|
||||
if [ $(date -d $(cat /etc/nasversion) +%s) -lt ${date_20230818} ]; then
|
||||
_exit 1 "请升级到 20230818 或更新的版本后再执行此命令!"
|
||||
fi
|
||||
|
||||
if [ $(df -T|grep /tmp|awk '{print int($5)}') -lt 358400 ]; then
|
||||
rm -rf /tmp/*
|
||||
fi
|
||||
|
||||
is64bit=$(getconf LONG_BIT)
|
||||
if [ "${is64bit}" != '64' ];then
|
||||
_exit 1 "抱歉, 当前系统切换版本不支持32位系统, 请使用64位系统!";
|
||||
fi
|
||||
|
||||
for index in "${!system_versions[@]}"; do
|
||||
printStr green "$index. $(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
done
|
||||
|
||||
while :; do
|
||||
printStr yellow "你想要安装哪个版本? 输入数字后按回车确定:"
|
||||
read version_number
|
||||
for index in "${!system_versions[@]}"; do
|
||||
if [ "$version_number" = "$index" ]; then
|
||||
selected_version="$(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
dlfile="$(echo ${system_versions[$index]}|awk '{print $2}')"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
echo "正在检测最快节点服务器"
|
||||
get_mirror_url
|
||||
[ -z ${NODE_URL} ] && _exit 1 "所有下载节点服务器网络不可达,稍后再试,或联系群主修复。"
|
||||
rm -rf /tmp/*
|
||||
wget -4 -q --show-progress --no-check-certificate ${NODE_URL}/${dlfile} -O /root/${dlfile} || _exit 1 "下载失败,请重试"
|
||||
[ "$(get_md5 -c ${NODE_URL}/${dlfile}.md5sum ${dlfile})" != "$(get_md5 -l /root/${dlfile})" ] && _exit 1 "文件校验失败,请重试"
|
||||
printStr green "正在配置系统,请稍后..."
|
||||
mv /root/${dlfile} /root/backup-64.gz
|
||||
mkdir -p /tmp/backup
|
||||
mount /dev/mmcblk0p8 /tmp/backup
|
||||
mv /root/backup-64.gz /tmp/backup
|
||||
sync
|
||||
umount /tmp/backup
|
||||
|
||||
printStr yellow "
|
||||
==============================================================
|
||||
配置已完成,盒子正在重启并准备初始化中,
|
||||
请关闭电源重新上电,8分钟后手动重启电源第二次,并继续稍等初始化结束
|
||||
=============================================================="
|
||||
recoverbackup -a
|
||||
81
static/mv23-bt.sh
Executable file
81
static/mv23-bt.sh
Executable file
@@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare -a system_versions
|
||||
system_versions=(
|
||||
[1]='海纳思NAS社区版固件 Ubuntu-20.04.5-arm64.gz'
|
||||
[2]='海纳思宝塔收费专用固件 Ubuntu-bt-arm64.gz'
|
||||
)
|
||||
|
||||
echo "
|
||||
+----------------------------------------------------------------------
|
||||
| 海纳思系统固件切换专用脚本温馨提示:
|
||||
+----------------------------------------------------------------------
|
||||
| 切换后原系统将完全清除,请注意保存资料。
|
||||
+----------------------------------------------------------------------
|
||||
| 如果不确定,请按CTRL+C结束此脚本.
|
||||
+----------------------------------------------------------------------
|
||||
"
|
||||
|
||||
temp_file=$(mktemp)
|
||||
curl -sSL https://hi.ecoo.top/mirror-utils.sh > $temp_file
|
||||
if [ ! -f /etc/public-download.sh ] || [ "$(cat $temp_file|md5sum|awk '{print $1}')" != "$(cat /etc/public-download.sh|md5sum|awk '{print $1}')" ]; then
|
||||
cp $temp_file /etc/public-download.sh
|
||||
fi
|
||||
rm -f $temp_file
|
||||
source /etc/public-download.sh
|
||||
|
||||
if [ $(whoami) != "root" ];then
|
||||
_exit 1 "请使用root权限切换系统命令!"
|
||||
fi
|
||||
|
||||
date_20230818=$(date -d '20230818' +%s)
|
||||
if [ $(date -d $(cat /etc/nasversion) +%s) -lt ${date_20230818} ]; then
|
||||
_exit 1 "请升级到 20230818 或更新的版本后再执行此命令!"
|
||||
fi
|
||||
|
||||
if [ $(df -T|grep /tmp|awk '{print int($5)}') -lt 358400 ]; then
|
||||
rm -rf /tmp/*
|
||||
fi
|
||||
|
||||
is64bit=$(getconf LONG_BIT)
|
||||
if [ "${is64bit}" != '64' ];then
|
||||
_exit 1 "抱歉, 当前系统切换版本不支持32位系统, 请使用64位系统!";
|
||||
fi
|
||||
|
||||
for index in "${!system_versions[@]}"; do
|
||||
printStr green "$index. $(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
done
|
||||
|
||||
while :; do
|
||||
printStr yellow "你想要安装哪个版本? 输入数字后按回车确定:"
|
||||
read version_number
|
||||
for index in "${!system_versions[@]}"; do
|
||||
if [ "$version_number" = "$index" ]; then
|
||||
selected_version="$(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
dlfile="$(echo ${system_versions[$index]}|awk '{print $2}')"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
printStr yellow "检测并选定下载节点..."
|
||||
get_mirror_url
|
||||
|
||||
rm -rf /tmp/*
|
||||
printStr yellow "下载刷机包..."
|
||||
dl_get update/system/${dlfile} /root/${dlfile}
|
||||
[ "$(get_md5 -c ${NODE_URL}/update/system/${dlfile}.md5sum ${dlfile})" != "$(get_md5 -l /root/${dlfile})" ] && _exit 1 "文件校验失败,请重试"
|
||||
printStr green "正在配置系统,请稍后..."
|
||||
mv /root/${dlfile} /root/backup-64.gz
|
||||
mkdir -p /tmp/backup
|
||||
mount /dev/mmcblk0p8 /tmp/backup
|
||||
mv /root/backup-64.gz /tmp/backup
|
||||
sync
|
||||
umount /tmp/backup
|
||||
|
||||
printStr yellow "
|
||||
==============================================================
|
||||
配置已完成,盒子正在重启并准备初始化中,
|
||||
请关闭电源重新上电,8分钟后手动重启电源第二次,并继续稍等初始化结束
|
||||
=============================================================="
|
||||
recoverbackup -a
|
||||
77
static/mv23-wx.sh
Executable file
77
static/mv23-wx.sh
Executable file
@@ -0,0 +1,77 @@
|
||||
#!/bin/bash
|
||||
|
||||
dl_url="https://node.histb.com:9088/update/system"
|
||||
declare -a system_versions
|
||||
system_versions=(
|
||||
[1]='网心云专用固件 onething-64.gz'
|
||||
[2]='海纳思NAS系统固件 Ubuntu-20.04.5-arm64.gz'
|
||||
)
|
||||
|
||||
echo "
|
||||
+----------------------------------------------------------------------
|
||||
| 海纳思系统网心云固件切换专用脚本温馨提示:
|
||||
+----------------------------------------------------------------------
|
||||
| 切换后原系统将完全清除,请注意保存资料。
|
||||
+----------------------------------------------------------------------
|
||||
| 如果不确定,请按CTRL+C结束此脚本.
|
||||
+----------------------------------------------------------------------
|
||||
"
|
||||
|
||||
temp_file=$(mktemp)
|
||||
curl -sSL https://hi.ecoo.top/mirror-utils.sh > $temp_file
|
||||
if [ ! -f /etc/public-download.sh ] || [ "$(cat $temp_file|md5sum|awk '{print $1}')" != "$(cat /etc/public-download.sh|md5sum|awk '{print $1}')" ]; then
|
||||
cp $temp_file /etc/public-download.sh
|
||||
fi
|
||||
rm -f $temp_file
|
||||
source /etc/public-download.sh
|
||||
|
||||
if [ $(whoami) != "root" ];then
|
||||
_exit 1 "请使用root权限切换系统命令!"
|
||||
fi
|
||||
|
||||
nasversion=`cat /etc/nasversion`
|
||||
#if [ $nasversion != "20230818" ];then
|
||||
# _exit 1 "请使用最新20230818系统!"
|
||||
#fi
|
||||
|
||||
is64bit=$(getconf LONG_BIT)
|
||||
if [ "${is64bit}" != '64' ];then
|
||||
_exit 1 "抱歉, 当前系统切换版本不支持32位系统, 请使用64位系统!";
|
||||
fi
|
||||
|
||||
for index in "${!system_versions[@]}"; do
|
||||
printStr green "$index. $(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
done
|
||||
|
||||
while :; do
|
||||
printStr yellow "你想要安装哪个版本? 输入数字后按回车确定:"
|
||||
read version_number
|
||||
for index in "${!system_versions[@]}"; do
|
||||
if [ "$version_number" = "$index" ]; then
|
||||
selected_version="$(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
dlfile="$(echo ${system_versions[$index]}|awk '{print $2}')"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
printStr yellow "检测并选定下载节点..."
|
||||
get_mirror_url
|
||||
|
||||
printStr yellow "下载刷机包..."
|
||||
dl_get update/system/${dlfile} /tmp/${dlfile}
|
||||
[ "$(get_md5 -c ${NODE_URL}/update/system/${dlfile}.md5sum ${dlfile})" != "$(get_md5 -l /tmp/${dlfile})" ] && _exit 1 "文件校验失败,请重试"
|
||||
|
||||
mv /tmp/${dlfile} /tmp/backup-64.gz
|
||||
mkdir -p /tmp/backup
|
||||
mount /dev/mmcblk0p8 /tmp/backup
|
||||
mv /tmp/backup-64.gz /tmp/backup
|
||||
sync
|
||||
umount /tmp/backup
|
||||
|
||||
printStr yellow "
|
||||
==============================================================
|
||||
配置已完成,盒子正在重启并准备初始化中,
|
||||
若5分钟后还没有获得ip,请手动重启盒子,并继续稍等初始化结束
|
||||
=============================================================="
|
||||
recoverbackup
|
||||
74
static/mv300_upgrade.sh
Executable file
74
static/mv300_upgrade.sh
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/bin/bash
|
||||
|
||||
dlfile="mv300-99.flash.gz" # 文件路径
|
||||
|
||||
echo "
|
||||
+----------------------------------------------------------------------
|
||||
| 海纳思系统hi3798mv300升级系统专用脚本温馨提示:
|
||||
+----------------------------------------------------------------------
|
||||
| 此专用脚本可以让你在任意版本的NAS系统下一键升级到20240201,
|
||||
+----------------------------------------------------------------------
|
||||
| 升级20240201版专用,原系统将完全清除,请注意保存资料。
|
||||
+----------------------------------------------------------------------
|
||||
| 如果不确定,请按CTRL+C结束此脚本.
|
||||
+----------------------------------------------------------------------
|
||||
"
|
||||
read -p "继续执行?[y/n]: " result
|
||||
[ "${result^^}" != "Y" ] && exit
|
||||
|
||||
temp_file=$(mktemp)
|
||||
curl -sSL https://hi.ecoo.top/mirror-utils.sh > $temp_file
|
||||
if [ ! -f /etc/public-download.sh ] || [ "$(cat $temp_file|md5sum|awk '{print $1}')" != "$(cat /etc/public-download.sh|md5sum|awk '{print $1}')" ]; then
|
||||
cp $temp_file /etc/public-download.sh
|
||||
fi
|
||||
rm -f $temp_file
|
||||
source /etc/public-download.sh
|
||||
|
||||
model=$(cpuid)
|
||||
platform=hi3798mv300
|
||||
|
||||
if [ "$(echo ${model})" != "$platform" ];then
|
||||
_exit 1 "本升级程序仅支持${platform}机型!"
|
||||
fi
|
||||
|
||||
if [ $(whoami) != "root" ];then
|
||||
_exit 1 "请使用root权限切换系统命令!"
|
||||
fi
|
||||
|
||||
is64bit=$(getconf LONG_BIT)
|
||||
if [ "${is64bit}" != '64' ];then
|
||||
_exit 1 "抱歉, 当前系统切换版本不支持32位系统, 请使用64位系统!";
|
||||
fi
|
||||
|
||||
promode=$(uname -r|cut -c 13-)
|
||||
if [ $promode = 36010066 ];then
|
||||
_exit 1 "专业版用户请使用vipupgrade命令进行升级!"
|
||||
fi
|
||||
#nasversion=`cat /etc/nasversion`
|
||||
#if [ $nasversion = "20230101" ];then
|
||||
# _exit 1 "已经是20230101最新版,无需升级系统!"
|
||||
#fi
|
||||
|
||||
space_left=$(df -hT|grep /dev/root|awk '{print $4}')
|
||||
if [ "$(expr $(echo ${space_left%%G}) \> 1)" != 1 ];then
|
||||
_exit 1 "请确保剩余空间大于1G!"
|
||||
fi
|
||||
|
||||
printStr yellow "检测并选定下载节点..."
|
||||
get_mirror_url
|
||||
|
||||
|
||||
printStr yellow "下载刷机包..."
|
||||
dl_get update/system/${dlfile} /${dlfile}
|
||||
printStr yellow "校验刷机包..."
|
||||
[ "$(get_md5 -c ${NODE_URL}/update/system/${dlfile}.md5sum ${dlfile})" != "$(get_md5 -l /${dlfile})" ] && _exit 1 "文件校验失败,请重试"
|
||||
printStr green "下载完成!"
|
||||
|
||||
printStr yellow "刷机中,请勿断电..."
|
||||
gunzip -c /${dlfile} | dd of=/dev/mmcblk0 bs=1024 seek=1024 status=progress conv=sync
|
||||
|
||||
[[ $? == 0 ]] && printStr yellow "
|
||||
==============================================================
|
||||
刷机已完成,请手工关闭电源并再次开启,等待初始化5-8分钟即可。
|
||||
==============================================================" && reboot || \
|
||||
_exit 1 "刷机失败"
|
||||
BIN
static/n2_syno
Normal file
BIN
static/n2_syno
Normal file
Binary file not shown.
82
static/n2_syno.sh
Executable file
82
static/n2_syno.sh
Executable file
@@ -0,0 +1,82 @@
|
||||
#!/bin/bash
|
||||
|
||||
dl_url="https://dl.ecoo.top/synology"
|
||||
|
||||
readonly COLOUR_RESET='\e[0m'
|
||||
declare -A COLORS
|
||||
COLORS=(
|
||||
["red"]='\e[91m'
|
||||
["green"]='\e[32;1m'
|
||||
["yellow"]='\e[33m'
|
||||
)
|
||||
|
||||
printStr() {
|
||||
color=$1
|
||||
printf ${COLORS[${color}]}"$2"${COLOUR_RESET}"\n"
|
||||
return 0
|
||||
}
|
||||
|
||||
_exit() {
|
||||
exit_singal=$1
|
||||
shift
|
||||
[ "$exit_singal" != "0" ] && printStr red "$*" || printStr green "$*"
|
||||
exit $exit_singal
|
||||
}
|
||||
|
||||
get_md5() {
|
||||
case $1 in
|
||||
-c)
|
||||
shift
|
||||
wget -q $1 -O - | grep $2 | awk '{print $1}'
|
||||
;;
|
||||
-l)
|
||||
shift
|
||||
[ ! -f "$1" ] && return 1
|
||||
md5sum $1 2> /dev/null | awk '{print $1}'
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
echo "
|
||||
+----------------------------------------------------------------------
|
||||
| 黑群晖安装系统 N2 恩兔 专用脚本温馨提示:
|
||||
+----------------------------------------------------------------------
|
||||
| 此专用脚本可以让你在任意版本的NAS系统下一键安装黑群晖系统,
|
||||
+----------------------------------------------------------------------
|
||||
| N2 恩兔 专用,原系统将完全清除,请注意保存资料。
|
||||
+----------------------------------------------------------------------
|
||||
| 如果不确定,请按CTRL+C结束此脚本.
|
||||
+----------------------------------------------------------------------
|
||||
"
|
||||
read -p "输入安装密码继续执行?[y/n]: " result
|
||||
[ "${result^^}" != "123" ] && exit
|
||||
|
||||
model=$(cat /etc/regname | cut -b 7-12)
|
||||
platform=mv200
|
||||
|
||||
if [ "$(echo ${model})" != "$platform" ];then
|
||||
_exit 1 "本升级程序仅支持hi1798${platform}机型!"
|
||||
fi
|
||||
|
||||
if [ $(whoami) != "root" ];then
|
||||
_exit 1 "请使用root权限切换系统命令!"
|
||||
fi
|
||||
|
||||
dlfile="n2-synology.flash.gz"
|
||||
|
||||
printStr yellow "下载刷机包...移动网速度稍慢,电信和联通速度很快"
|
||||
wget -q --show-progress --no-check-certificate ${dl_url}/${dlfile} -O /${dlfile} || _exit 1 "下载失败,请重试"
|
||||
printStr yellow "校验刷机包..."
|
||||
[ "$(get_md5 -c ${dl_url}/${dlfile}.md5sum ${dlfile})" != "$(get_md5 -l /${dlfile})" ] && _exit 1 "文件校验失败,请重试"
|
||||
printStr green "下载完成!"
|
||||
|
||||
printStr yellow "刷机中,请勿断电..."
|
||||
gunzip -c /${dlfile} | dd of=/dev/mmcblk0 bs=1024 status=progress conv=sync
|
||||
|
||||
[[ $? == 0 ]] && printStr yellow "
|
||||
================================================================
|
||||
刷机完成,请手工关闭电源并再次开启,运行Synology Assistant查找并安装。
|
||||
================================================================" && reboot || \
|
||||
_exit 1 "刷机失败"
|
||||
|
||||
127
static/n2_upgrade.sh
Executable file
127
static/n2_upgrade.sh
Executable file
@@ -0,0 +1,127 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare -A node_url_map=(
|
||||
["nm"]="https://node.histb.com:9088/update/system"
|
||||
["hn"]="https://node3.histb.com:9088/update/system"
|
||||
["hk"]="https://node2.histb.com/update/system"
|
||||
["dl"]="https://dl.ecoo.top/update/system"
|
||||
)
|
||||
|
||||
dlfile="n2-99.flash.gz" # 文件路径
|
||||
|
||||
dl_node=""
|
||||
|
||||
readonly COLOUR_RESET='\e[0m'
|
||||
declare -A COLORS
|
||||
COLORS=(
|
||||
["red"]='\e[91m'
|
||||
["green"]='\e[32;1m'
|
||||
["yellow"]='\e[33m'
|
||||
)
|
||||
|
||||
printStr() {
|
||||
color=$1
|
||||
printf ${COLORS[${color}]}"$2"${COLOUR_RESET}"\n"
|
||||
return 0
|
||||
}
|
||||
|
||||
_exit() {
|
||||
exit_singal=$1
|
||||
shift
|
||||
[ "$exit_singal" != "0" ] && printStr red "$*" || printStr green "$*"
|
||||
exit $exit_singal
|
||||
}
|
||||
|
||||
get_md5() {
|
||||
case $1 in
|
||||
-c)
|
||||
shift
|
||||
wget -q -4 $1 -O - | grep $2 | awk '{print $1}'
|
||||
;;
|
||||
-l)
|
||||
shift
|
||||
[ ! -f "$1" ] && return 1
|
||||
md5sum $1 2> /dev/null | awk '{print $1}'
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
echo "
|
||||
+----------------------------------------------------------------------
|
||||
| 海纳思系统hi3798mv200升级系统 N2 恩兔 专用脚本温馨提示:
|
||||
+----------------------------------------------------------------------
|
||||
| 此专用脚本可以让你在任意版本的NAS系统下一键升级到20231201,
|
||||
+----------------------------------------------------------------------
|
||||
| 升级20231201版专用,原系统将完全清除,请注意保存资料。
|
||||
+----------------------------------------------------------------------
|
||||
| 如果不确定,请按CTRL+C结束此脚本.
|
||||
+----------------------------------------------------------------------
|
||||
"
|
||||
read -p "继续执行?[y/n]: " result
|
||||
[ "${result^^}" != "Y" ] && exit
|
||||
|
||||
model=$(cat /etc/regname | cut -b 7-12)
|
||||
platform=mv200
|
||||
|
||||
if [ "$(echo ${model})" != "$platform" ];then
|
||||
_exit 1 "本升级程序仅支持hi1798${platform}机型!"
|
||||
fi
|
||||
|
||||
if [ $(whoami) != "root" ];then
|
||||
_exit 1 "请使用root权限切换系统命令!"
|
||||
fi
|
||||
|
||||
promode=$(uname -r|cut -c 13-)
|
||||
if [ $promode = 26010066 ];then
|
||||
_exit 1 "专业版用户请使用vipupgrade命令进行升级!"
|
||||
fi
|
||||
|
||||
is64bit=$(getconf LONG_BIT)
|
||||
if [ "${is64bit}" != '64' ];then
|
||||
_exit 1 "抱歉, 当前系统切换版本不支持32位系统, 请使用64位系统!";
|
||||
fi
|
||||
|
||||
#nasversion=`cat /etc/nasversion`
|
||||
#if [ $nasversion = "20230101" ];then
|
||||
# _exit 1 "已经是20230101最新版,无需升级系统!"
|
||||
#fi
|
||||
|
||||
space_left=$(df -hT|grep /dev/root|awk '{print $4}')
|
||||
if [ "$(expr $(echo ${space_left%%G}) \> 1)" != 1 ];then
|
||||
_exit 1 "请确保剩余空间大于1G!"
|
||||
fi
|
||||
|
||||
printStr yellow "检测并选定下载节点..."
|
||||
for node in "${!node_url_map[@]}"; do
|
||||
url=${node_url_map[$node]}
|
||||
|
||||
if curl --output /dev/null --silent --head --fail -m 3 "$url/$dlfile"; then
|
||||
dl_node=$node
|
||||
break
|
||||
else
|
||||
printStr yellow "$node 不可访问,尝试下一个节点"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -z "$dl_node" ]; then
|
||||
printStr green "选定下载地址为节点: $dl_node"
|
||||
dl_url=${node_url_map[$dl_node]}
|
||||
else
|
||||
_exit 1 "所有节点均不可访问"
|
||||
fi
|
||||
printStr yellow "下载刷机包..."
|
||||
wget -q --show-progress --no-check-certificate ${dl_url}/${dlfile} -O /${dlfile} || _exit 1 "下载失败,请重试"
|
||||
printStr yellow "校验刷机包..."
|
||||
[ "$(get_md5 -c ${dl_url}/${dlfile}.md5sum ${dlfile})" != "$(get_md5 -l /${dlfile})" ] && _exit 1 "文件校验失败,请重试"
|
||||
printStr green "下载完成!"
|
||||
|
||||
printStr yellow "刷机中,请勿断电..."
|
||||
gunzip -c /${dlfile} | dd of=/dev/mmcblk0 bs=1024 seek=1024 status=progress conv=sync
|
||||
|
||||
[[ $? == 0 ]] && printStr yellow "
|
||||
==============================================================
|
||||
刷机已完成,请手工关闭电源并再次开启,等待初始化5-8分钟即可。
|
||||
==============================================================" && reboot || \
|
||||
_exit 1 "刷机失败"
|
||||
|
||||
70
static/npc.sh
Executable file
70
static/npc.sh
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
# scripts for npc install
|
||||
|
||||
dl_mirrors=("https://dl.ecoo.top" "https://www.ecoo.top")
|
||||
|
||||
readonly COLOUR_RESET='\e[0m'
|
||||
declare -A COLORS
|
||||
COLORS=(
|
||||
["red"]='\e[91m'
|
||||
["green"]='\e[32;1m'
|
||||
["yellow"]='\e[33m'
|
||||
["grey"]='\e[90m'
|
||||
)
|
||||
readonly GREEN_LINE=" ${COLORS[green]}─────────────────────────────────────────────────────$COLOUR_RESET\n"
|
||||
|
||||
printStr() {
|
||||
color=$1
|
||||
printf ${COLORS[${color}]}"$2"${COLOUR_RESET}"\n"
|
||||
}
|
||||
|
||||
_exit() {
|
||||
exit_singal=$1
|
||||
shift
|
||||
[ "$exit_singal" != "0" ] && printStr red "$*" || printStr green "$*"
|
||||
exit $exit_singal
|
||||
}
|
||||
|
||||
dl_get() {
|
||||
file_url=$1
|
||||
save_path=$2
|
||||
[ ! -d $save_path ] && mkdir -p $save_path
|
||||
for(( i=0;i<${#dl_mirrors[@]};i++));do
|
||||
echo "${dl_mirrors[i]}"
|
||||
wget --no-check-certificate ${dl_mirrors[i]}/${file_url} -P $save_path && printStr green "Successed download ${file_url}" && return
|
||||
done
|
||||
|
||||
_exit 1 "Download $file_url failed"
|
||||
}
|
||||
|
||||
dl_npc() {
|
||||
if [ ! -d /opt/npc ]; then
|
||||
printStr yellow "npc: adding new directry"
|
||||
mkdir -p /opt/npc
|
||||
dl_get "update/soft_init/npc-$(getconf LONG_BIT)" /opt/npc
|
||||
mv /opt/npc/npc-$(getconf LONG_BIT) /opt/npc/npc
|
||||
chmod +x /opt/npc/npc
|
||||
printStr yellow "npc: download successed"
|
||||
printf $GREEN_LINE
|
||||
fi
|
||||
}
|
||||
|
||||
setup_npc() {
|
||||
if [ -f /opt/npc/npc ]; then
|
||||
printStr yellow "npc: setup progress"
|
||||
read -p "输入报名的手机号码:" phone
|
||||
cd /opt/npc
|
||||
./npc install -server=3.101.108.218:8024 -vkey=$phone
|
||||
sleep 2
|
||||
npc start
|
||||
printStr yellow "npc: setup successed"
|
||||
printStr yellow "npc: 已经成功安装并运行"
|
||||
printStr yellow "npc: 请访问你的测试域名"
|
||||
printf $GREEN_LINE
|
||||
fi
|
||||
}
|
||||
|
||||
dl_npc
|
||||
setup_npc
|
||||
|
||||
_exit 0 "all upgraded successed"
|
||||
1
static/nst/1cg3cz.nst
Normal file
1
static/nst/1cg3cz.nst
Normal file
@@ -0,0 +1 @@
|
||||
xV0A3f33zvbv7rMnUN7uylxtGqtf0bHaOG+KpkSJnE/lrvyCCSZ3NqhluZNtDW+0vQMJnDUuISEIQn8iteBJjQ56wxDU1ZVg+tzpDckSl7DAAcK9frxLNIzXAu37QteYY6U8teCqZ9Ay6AFGOM1Ae4Qu9FaawOkZE8sWvWONd9W9pEoBcY7twPPd3GSrxu6zgYvsfxYkQtU9t+WIW66DHkRXmV5Izi/FFQzYzhvAT7IlGcseccZd8hGHfcNQfytYe+0Icbkg12FK4p3Dh9qOxABPrRxF9pPMiGZHdqvk8qA=
|
||||
1
static/nst/240G.nst
Normal file
1
static/nst/240G.nst
Normal file
@@ -0,0 +1 @@
|
||||
2neZNThvEEX8eE1qpohItSmYwSZfh0UhRwnWQdiwYg3E1i17KkKoNlj3lQp9BZ2F3VTjpKUh6jk30YQEhysisek+c6pqLSGuINp6zz9i6H6UUMA1Bv0D//9yhHVXVbELIpWORq6dxjU+0RnYmj/RY3hhhpQtyMPEhvA6WQk0xTpSVs0V/TuzxlYLWA9faJ7UWt0i3N/h0nGLoYEyKHC9aUNMli6+R5RaC5/u0DrUUeVMYDJImiRA+EkYFBNICkkPRWacXdOHZgDSQbmEwUpAvaqnfAn9xmZZm6pV6Rbx4ieZae+rr4j2UIB+KGKSAun1M4AH+YR2+wcN7dMagA2gakKIhI9XdmPUXHgmRWlcrDP5lnZP+N5O2NjSjr+XOa1v+M7JX9/c44K1tjUmT6N4EQ==
|
||||
1
static/nst/4cg.nst
Normal file
1
static/nst/4cg.nst
Normal file
@@ -0,0 +1 @@
|
||||
Et5eVgMjInRCUjyjbEIQQIAyTAXfgHDqPquqk0yW9lSPBKGEBN28Piw/IxaAftUGMLNzo41ddpsUo59iue9wN3cflHILG9IT43LxfyHgSI+jp0C0o2FYz+d4n0ovE37l6MMUv6E20UaNvMGcgLFUjF70wWCOGFygM29Vu+ddBA9G96TkWF/SRodwQuAKp6imQr6LKtuIdMdPfb38Til2/g==
|
||||
1
static/nst/4cz.nst
Normal file
1
static/nst/4cz.nst
Normal file
@@ -0,0 +1 @@
|
||||
ofglhyaldDOUKQ3YhLVpzXgmpkH7LN+1QbGLyCNin6tdPpTsJXgU73r2Lae3+JF12/6/GlKaGbGLoXxa98Oe5O1d9x4U3MVoaBEUTEvOnCJGtzgKdZolNTLKMo6bW32dRyk0+s1jJpast8+NfR50b1b+6t56iRsZ0dwXc0HPoVCyyWusSB1Qjed2jkCevcvPPt51SE9cHB15B8QcrO2mHg==
|
||||
1
static/nst/500G.nst
Normal file
1
static/nst/500G.nst
Normal file
@@ -0,0 +1 @@
|
||||
kXdkhFg1+jt5n4M5xH5/YE3LoTSPyaKg0eg8T3rLGS4Kx1cQNSko7OdhpStElxo4jwNg1/53lk2ptDP3YpfsJ6QPqUZW3bwmt1s94a22zommKv7olIxsa7YfK+/SvLV8SALJ2IrXQihYRs4N46tvDeG8crY8wo+U0QS+0GSx4EODxMkVu5bErJuSecHZMD/yREoI/ln3H2AqiGj7Sbi5MIY7cGiF/0wQ425f9qFbJi8QVP8H7XeYIGnu7sd392dEcDTtWDIUU05G1iPQo36OPecrMw+4Xv7a9phCHS2/siY60foVIhyQHDNRzBr6AwNIb9PWNyI6ISTX+1V+1JwWCtEEPs444nBUHN1fbAtqK/In7DHtRcAApS/i0u2aUH9enWOpvqqat+ADuLr4KyRqj8cX+4/qmzEnNh49und/+HkcEALXcZcHwgpEVW4z3yZMIID9JB0Yh/fC0V8RjaINLhtF9yQtu4/7rt+as5okFHayfwktka21ipzKovzZOUtjtEr5RkR+cva/wS/5x2ldtk6jDP4U4n/1BylR2soUe+cG+LkJ5Lt66oc6WBzU4wi6KONuHcEwtOg5sJCfdyHig/oxDlvAK8W+kxNqCnlMPhtQpAOK3/b27bG9WmN59U9Y
|
||||
1
static/nst/501.nst
Normal file
1
static/nst/501.nst
Normal file
@@ -0,0 +1 @@
|
||||
aDD2bP6EcXVMP7ULevznikikwbVwhLhXZiRJrmZPs7q2gl3Dw9W6t3bjXo2YlCZXHEYn+6efKnbzaZjCJuuupDNKwNe5qeQqhJeuLCQ5KAi2t/PYHic8UCX1gthWuiJyCR8vrW1FwuJg8oyk/KnofejTUXJGgoCDYO4yZ3AD2Vi9Ret+BBBSkKB8nBOnnORPJNTGN6BkUycEx8NMQk6QJvm5bOPUufmLB1D7NCl5u972V328daGmNp9zwgjHjH/gSz9ZryVcs6dz66NQKD1e1HQB3ESL3Lrs51j8ZNNtYiew8xFl5WVZDH6DpqKcR9tb9wUXEc4a4HzSVQmZclT6gV8UoS4zyiEobJZQHn7oXlc/GSJLUh2kH/N36o3P3qY75Qx3HoMt8EiUjtuBdKgi82eVs5EPa/m2ZMPZKZjUm+ImDX32xiZmngurRMICIv2tt9GnZLgeU2UgFWnwCO1ui08GyN6WiRV0KdGkilY/S6rSCx4KpGA5z/SDV41vQvZ5VCJv2UB0I4lQzH7fRvk/9w3QCTbshg9odc4215F+REyXHKxVbyxHgy7UGb2+gWMjSTZfbLG1SjQykbK23RbtRJd/JM21sHBQkc1z/LTDWbAMgoLykosG0QS7AeGDdSk/
|
||||
1
static/nst/cbczcxcyk.nst
Normal file
1
static/nst/cbczcxcyk.nst
Normal file
@@ -0,0 +1 @@
|
||||
d241vl+lqW/yYDdPnDAS9B3OKjil3vM8a8XpM+O+vSQ1sJgyTGu8BwPavSC5Dy6OcxTo3+kf50fOwhaPbRc/4QHwkhIL+E8ATyjOl+XHUtBFDSrknq4+JuDpH8fu8bbyodAPWAXkUTXpYmb4+/oRRPoh4htJzgXnpkSvh6+I9aH6CQmr+7L/bu8NXjfV/SvH39Or7CLp4nG8htqRq+uF9hO++nN8cgXrJvaVsVl78i/5QUv8vdZJrNue96iChKqaM+a+x5hBwHjxLeO19LBWwZLsi8kp6e0MRJ/Cwuzx25+K5zIsyVCYaSPeAQ3tdvHnCR70D0qgnBJKUrHl3YdDASSBW/NxqPCvRgv2gw0RcZsEWZrqytwX2AMYKg1ENAEQXQ3k1I8KwQeiIS5QBGdVJoYQuvLJowSkdTw07UBZUt5KEL+cYzGmshakqZjdWx3P
|
||||
694
static/nst/install-v2ray.sh
Normal file
694
static/nst/install-v2ray.sh
Normal file
@@ -0,0 +1,694 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2268
|
||||
|
||||
DAT_PATH=${DAT_PATH:-/usr/local/share/v2ray}
|
||||
JSON_PATH=${JSON_PATH:-/usr/local/etc/v2ray}
|
||||
|
||||
curl() {
|
||||
$(type -P curl) -L -q --retry 5 --retry-delay 10 --retry-max-time 60 "$@"
|
||||
}
|
||||
|
||||
systemd_cat_config() {
|
||||
if systemd-analyze --help | grep -qw 'cat-config'; then
|
||||
systemd-analyze --no-pager cat-config "$@"
|
||||
echo
|
||||
else
|
||||
echo "${aoi}~~~~~~~~~~~~~~~~"
|
||||
cat "$@" "$1".d/*
|
||||
echo "${aoi}~~~~~~~~~~~~~~~~"
|
||||
echo "${red}warning: ${green}The systemd version on the current operating system is too low."
|
||||
echo "${red}warning: ${green}Please consider to upgrade the systemd or the operating system.${reset}"
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
||||
check_if_running_as_root() {
|
||||
# If you want to run as another user, please modify $UID to be owned by this user
|
||||
if [[ "$UID" -ne '0' ]]; then
|
||||
echo "WARNING: The user currently executing this script is not root. You may encounter the insufficient privilege error."
|
||||
read -r -p "Are you sure you want to continue? [y/n] " cont_without_been_root
|
||||
if [[ x"${cont_without_been_root:0:1}" = x'y' ]]; then
|
||||
echo "Continuing the installation with current user..."
|
||||
else
|
||||
echo "Not running with root, exiting..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
identify_the_operating_system_and_architecture() {
|
||||
if [[ "$(uname)" == 'Linux' ]]; then
|
||||
case "$(uname -m)" in
|
||||
'i386' | 'i686')
|
||||
MACHINE='32'
|
||||
;;
|
||||
'amd64' | 'x86_64')
|
||||
MACHINE='64'
|
||||
;;
|
||||
'armv5tel')
|
||||
MACHINE='arm32-v5'
|
||||
;;
|
||||
'armv6l')
|
||||
MACHINE='arm32-v6'
|
||||
grep Features /proc/cpuinfo | grep -qw 'vfp' || MACHINE='arm32-v5'
|
||||
;;
|
||||
'armv7' | 'armv7l')
|
||||
MACHINE='arm32-v7a'
|
||||
grep Features /proc/cpuinfo | grep -qw 'vfp' || MACHINE='arm32-v5'
|
||||
;;
|
||||
'armv8' | 'aarch64')
|
||||
MACHINE='arm64-v8a'
|
||||
;;
|
||||
'mips')
|
||||
MACHINE='mips32'
|
||||
;;
|
||||
'mipsle')
|
||||
MACHINE='mips32le'
|
||||
;;
|
||||
'mips64')
|
||||
MACHINE='mips64'
|
||||
;;
|
||||
'mips64le')
|
||||
MACHINE='mips64le'
|
||||
;;
|
||||
'ppc64')
|
||||
MACHINE='ppc64'
|
||||
;;
|
||||
'ppc64le')
|
||||
MACHINE='ppc64le'
|
||||
;;
|
||||
'riscv64')
|
||||
MACHINE='riscv64'
|
||||
;;
|
||||
's390x')
|
||||
MACHINE='s390x'
|
||||
;;
|
||||
*)
|
||||
echo "error: The architecture is not supported."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
if [[ ! -f '/etc/os-release' ]]; then
|
||||
echo "error: Don't use outdated Linux distributions."
|
||||
exit 1
|
||||
fi
|
||||
# Do not combine this judgment condition with the following judgment condition.
|
||||
if [[ -f /.dockerenv ]] || grep -q 'docker\|lxc' /proc/1/cgroup && [[ "$(type -P systemctl)" ]]; then
|
||||
true
|
||||
elif [[ -d /run/systemd/system ]] || grep -q systemd <(ls -l /sbin/init); then
|
||||
true
|
||||
else
|
||||
echo "error: Only Linux distributions using systemd are supported."
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$(type -P apt)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='apt -y --no-install-recommends install'
|
||||
PACKAGE_MANAGEMENT_REMOVE='apt purge'
|
||||
package_provide_tput='ncurses-bin'
|
||||
elif [[ "$(type -P dnf)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='dnf -y install'
|
||||
PACKAGE_MANAGEMENT_REMOVE='dnf remove'
|
||||
package_provide_tput='ncurses'
|
||||
elif [[ "$(type -P yum)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='yum -y install'
|
||||
PACKAGE_MANAGEMENT_REMOVE='yum remove'
|
||||
package_provide_tput='ncurses'
|
||||
elif [[ "$(type -P zypper)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='zypper install -y --no-recommends'
|
||||
PACKAGE_MANAGEMENT_REMOVE='zypper remove'
|
||||
package_provide_tput='ncurses-utils'
|
||||
elif [[ "$(type -P pacman)" ]]; then
|
||||
PACKAGE_MANAGEMENT_INSTALL='pacman -Syu --noconfirm'
|
||||
PACKAGE_MANAGEMENT_REMOVE='pacman -Rsn'
|
||||
package_provide_tput='ncurses'
|
||||
else
|
||||
echo "error: The script does not support the package manager in this operating system."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "error: This operating system is not supported."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
## Demo function for processing parameters
|
||||
judgment_parameters() {
|
||||
while [[ "$#" -gt '0' ]]; do
|
||||
case "$1" in
|
||||
'--remove')
|
||||
if [[ "$#" -gt '1' ]]; then
|
||||
echo 'error: Please enter the correct parameters.'
|
||||
exit 1
|
||||
fi
|
||||
REMOVE='1'
|
||||
;;
|
||||
'--version')
|
||||
VERSION="${2:?error: Please specify the correct version.}"
|
||||
break
|
||||
;;
|
||||
'-c' | '--check')
|
||||
CHECK='1'
|
||||
break
|
||||
;;
|
||||
'-f' | '--force')
|
||||
FORCE='1'
|
||||
break
|
||||
;;
|
||||
'-h' | '--help')
|
||||
HELP='1'
|
||||
break
|
||||
;;
|
||||
'-l' | '--local')
|
||||
LOCAL_INSTALL='1'
|
||||
LOCAL_FILE="${2:?error: Please specify the correct local file.}"
|
||||
break
|
||||
;;
|
||||
'-p' | '--proxy')
|
||||
if [[ -z "${2:?error: Please specify the proxy server address.}" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
PROXY="$2"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "$0: unknown option -- -"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
install_software() {
|
||||
package_name="$1"
|
||||
file_to_detect="$2"
|
||||
type -P "$file_to_detect" > /dev/null 2>&1 && return
|
||||
if ${PACKAGE_MANAGEMENT_INSTALL} "$package_name"; then
|
||||
echo "info: $package_name is installed."
|
||||
else
|
||||
echo "error: Installation of $package_name failed, please check your network."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
get_version() {
|
||||
# 0: Install or update V2Ray.
|
||||
# 1: Installed or no new version of V2Ray.
|
||||
# 2: Install the specified version of V2Ray.
|
||||
if [[ -n "$VERSION" ]]; then
|
||||
RELEASE_VERSION="v${VERSION#v}"
|
||||
return 2
|
||||
fi
|
||||
# Determine the version number for V2Ray installed from a local file
|
||||
if [[ -f '/usr/local/bin/v2ray' ]]; then
|
||||
VERSION="$(/usr/local/bin/v2ray -version | awk 'NR==1 {print $2}')"
|
||||
CURRENT_VERSION="v${VERSION#v}"
|
||||
if [[ "$LOCAL_INSTALL" -eq '1' ]]; then
|
||||
RELEASE_VERSION="$CURRENT_VERSION"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
# Get V2Ray release version number
|
||||
TMP_FILE="$(mktemp)"
|
||||
if ! curl -x "${PROXY}" -sS -H "Accept: application/vnd.github.v3+json" -o "$TMP_FILE" 'https://api.github.com/repos/v2fly/v2ray-core/releases/latest'; then
|
||||
"rm" "$TMP_FILE"
|
||||
echo 'error: Failed to get release list, please check your network.'
|
||||
exit 1
|
||||
fi
|
||||
RELEASE_LATEST="$(sed 'y/,/\n/' "$TMP_FILE" | grep 'tag_name' | awk -F '"' '{print $4}')"
|
||||
"rm" "$TMP_FILE"
|
||||
RELEASE_VERSION="v${RELEASE_LATEST#v}"
|
||||
# Compare V2Ray version numbers
|
||||
if [[ "$RELEASE_VERSION" != "$CURRENT_VERSION" ]]; then
|
||||
RELEASE_VERSIONSION_NUMBER="${RELEASE_VERSION#v}"
|
||||
RELEASE_MAJOR_VERSION_NUMBER="${RELEASE_VERSIONSION_NUMBER%%.*}"
|
||||
RELEASE_MINOR_VERSION_NUMBER="$(echo "$RELEASE_VERSIONSION_NUMBER" | awk -F '.' '{print $2}')"
|
||||
RELEASE_MINIMUM_VERSION_NUMBER="${RELEASE_VERSIONSION_NUMBER##*.}"
|
||||
# shellcheck disable=SC2001
|
||||
CURRENT_VERSIONSION_NUMBER="$(echo "${CURRENT_VERSION#v}" | sed 's/-.*//')"
|
||||
CURRENT_MAJOR_VERSION_NUMBER="${CURRENT_VERSIONSION_NUMBER%%.*}"
|
||||
CURRENT_MINOR_VERSION_NUMBER="$(echo "$CURRENT_VERSIONSION_NUMBER" | awk -F '.' '{print $2}')"
|
||||
CURRENT_MINIMUM_VERSION_NUMBER="${CURRENT_VERSIONSION_NUMBER##*.}"
|
||||
if [[ "$RELEASE_MAJOR_VERSION_NUMBER" -gt "$CURRENT_MAJOR_VERSION_NUMBER" ]]; then
|
||||
return 0
|
||||
elif [[ "$RELEASE_MAJOR_VERSION_NUMBER" -eq "$CURRENT_MAJOR_VERSION_NUMBER" ]]; then
|
||||
if [[ "$RELEASE_MINOR_VERSION_NUMBER" -gt "$CURRENT_MINOR_VERSION_NUMBER" ]]; then
|
||||
return 0
|
||||
elif [[ "$RELEASE_MINOR_VERSION_NUMBER" -eq "$CURRENT_MINOR_VERSION_NUMBER" ]]; then
|
||||
if [[ "$RELEASE_MINIMUM_VERSION_NUMBER" -gt "$CURRENT_MINIMUM_VERSION_NUMBER" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
elif [[ "$RELEASE_VERSION" == "$CURRENT_VERSION" ]]; then
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
download_v2ray() {
|
||||
DOWNLOAD_LINK="https://git.histb.com/v2fly/v2ray-core/releases/download/$RELEASE_VERSION/v2ray-linux-$MACHINE.zip"
|
||||
echo "Downloading V2Ray archive: $DOWNLOAD_LINK"
|
||||
if ! curl -x "${PROXY}" -R -H 'Cache-Control: no-cache' -o "$ZIP_FILE" "$DOWNLOAD_LINK"; then
|
||||
echo 'error: Download failed! Please check your network or try again.'
|
||||
return 1
|
||||
fi
|
||||
echo "Downloading verification file for V2Ray archive: $DOWNLOAD_LINK.dgst"
|
||||
if ! curl -x "${PROXY}" -sSR -H 'Cache-Control: no-cache' -o "$ZIP_FILE.dgst" "$DOWNLOAD_LINK.dgst"; then
|
||||
echo 'error: Download failed! Please check your network or try again.'
|
||||
return 1
|
||||
fi
|
||||
if [[ "$(cat "$ZIP_FILE".dgst)" == 'Not Found' ]]; then
|
||||
echo 'error: This version does not support verification. Please replace with another version.'
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Verification of V2Ray archive
|
||||
for LISTSUM in 'md5' 'sha1' 'sha256' 'sha512'; do
|
||||
SUM="$(${LISTSUM}sum "$ZIP_FILE" | sed 's/ .*//')"
|
||||
CHECKSUM="$(grep ${LISTSUM^^} "$ZIP_FILE".dgst | grep "$SUM" -o -a | uniq)"
|
||||
if [[ "$SUM" != "$CHECKSUM" ]]; then
|
||||
echo 'error: Check failed! Please check your network or try again.'
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
decompression() {
|
||||
if ! unzip -q "$1" -d "$TMP_DIRECTORY"; then
|
||||
echo 'error: V2Ray decompression failed.'
|
||||
"rm" -r "$TMP_DIRECTORY"
|
||||
echo "removed: $TMP_DIRECTORY"
|
||||
exit 1
|
||||
fi
|
||||
echo "info: Extract the V2Ray package to $TMP_DIRECTORY and prepare it for installation."
|
||||
}
|
||||
|
||||
install_file() {
|
||||
NAME="$1"
|
||||
if [ "$NAME" == 'v2ray' ] ; then
|
||||
install -m 755 "${TMP_DIRECTORY}/$NAME" "/usr/local/bin/$NAME"
|
||||
elif [[ "$NAME" == 'geoip.dat' ]] || [[ "$NAME" == 'geosite.dat' ]]; then
|
||||
install -m 644 "${TMP_DIRECTORY}/$NAME" "${DAT_PATH}/$NAME"
|
||||
fi
|
||||
}
|
||||
|
||||
install_v2ray() {
|
||||
# Install V2Ray binary to /usr/local/bin/ and $DAT_PATH
|
||||
install_file v2ray
|
||||
install -d "$DAT_PATH"
|
||||
# If the file exists, geoip.dat and geosite.dat will not be installed or updated
|
||||
if [[ ! -f "${DAT_PATH}/.undat" ]]; then
|
||||
install_file geoip.dat
|
||||
install_file geosite.dat
|
||||
fi
|
||||
|
||||
# Install V2Ray configuration file to $JSON_PATH
|
||||
# shellcheck disable=SC2153
|
||||
if [[ -z "$JSONS_PATH" ]] && [[ ! -d "$JSON_PATH" ]]; then
|
||||
install -d "$JSON_PATH"
|
||||
cat <<EOT > "${JSON_PATH}/config.json"
|
||||
{
|
||||
"dns": {
|
||||
"hosts": {
|
||||
"domain:googleapis.cn": "googleapis.com"
|
||||
},
|
||||
"servers": [
|
||||
"1.1.1.1"
|
||||
]
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"port": 1080,
|
||||
"protocol": "socks",
|
||||
"settings": {
|
||||
"auth": "noauth",
|
||||
"udp": true,
|
||||
"userLevel": 8
|
||||
},
|
||||
"sniffing": {
|
||||
"destOverride": [
|
||||
"http",
|
||||
"tls"
|
||||
],
|
||||
"enabled": true
|
||||
},
|
||||
"tag": "socks"
|
||||
},
|
||||
{
|
||||
"port": 1089,
|
||||
"protocol": "http",
|
||||
"settings": {
|
||||
"userLevel": 8
|
||||
},
|
||||
"tag": "http"
|
||||
}
|
||||
],
|
||||
"log": {
|
||||
"loglevel": "warning"
|
||||
},
|
||||
"outbounds": [
|
||||
{
|
||||
"mux": {
|
||||
"concurrency": 8,
|
||||
"enabled": false
|
||||
},
|
||||
"protocol": "vmess",
|
||||
"settings": {
|
||||
"vnext": [
|
||||
{
|
||||
"address": "lirendian-lirentian0215.koyeb.app",
|
||||
"port": 443,
|
||||
"users": [
|
||||
{
|
||||
"alterId": 0,
|
||||
"encryption": "",
|
||||
"flow": "",
|
||||
"id": "225601bb-e174-4810-9828-8d50cf8ef3f9",
|
||||
"level": 8,
|
||||
"security": "auto"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"streamSettings": {
|
||||
"network": "ws",
|
||||
"security": "tls",
|
||||
"tlsSettings": {
|
||||
"allowInsecure": false,
|
||||
"serverName": "lirendian-lirentian0215.koyeb.app"
|
||||
},
|
||||
"wsSettings": {
|
||||
"headers": {
|
||||
"Host": "lirendian-lirentian0215.koyeb.app"
|
||||
},
|
||||
"path": "/vmess"
|
||||
}
|
||||
},
|
||||
"tag": "proxy"
|
||||
},
|
||||
{
|
||||
"protocol": "freedom",
|
||||
"settings": {},
|
||||
"tag": "direct"
|
||||
},
|
||||
{
|
||||
"protocol": "blackhole",
|
||||
"settings": {
|
||||
"response": {
|
||||
"type": "http"
|
||||
}
|
||||
},
|
||||
"tag": "block"
|
||||
}
|
||||
],
|
||||
"routing": {
|
||||
"domainMatcher": "mph",
|
||||
"domainStrategy": "IPIfNonMatch",
|
||||
"rules": [
|
||||
{
|
||||
"ip": [
|
||||
"1.1.1.1"
|
||||
],
|
||||
"outboundTag": "proxy",
|
||||
"port": "53",
|
||||
"type": "field"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
EOT
|
||||
CONFIG_NEW='1'
|
||||
fi
|
||||
|
||||
# Install V2Ray configuration file to $JSONS_PATH
|
||||
if [[ -n "$JSONS_PATH" ]] && [[ ! -d "$JSONS_PATH" ]]; then
|
||||
install -d "$JSONS_PATH"
|
||||
for BASE in 00_log 01_api 02_dns 03_routing 04_policy 05_inbounds 06_outbounds 07_transport 08_stats 09_reverse; do
|
||||
echo '{}' > "${JSONS_PATH}/${BASE}.json"
|
||||
done
|
||||
CONFDIR='1'
|
||||
fi
|
||||
|
||||
# Used to store V2Ray log files
|
||||
if [[ ! -d '/var/log/v2ray/' ]]; then
|
||||
if id nobody | grep -qw 'nogroup'; then
|
||||
install -d -m 700 -o nobody -g nogroup /var/log/v2ray/
|
||||
install -m 600 -o nobody -g nogroup /dev/null /var/log/v2ray/access.log
|
||||
install -m 600 -o nobody -g nogroup /dev/null /var/log/v2ray/error.log
|
||||
else
|
||||
install -d -m 700 -o nobody -g nobody /var/log/v2ray/
|
||||
install -m 600 -o nobody -g nobody /dev/null /var/log/v2ray/access.log
|
||||
install -m 600 -o nobody -g nobody /dev/null /var/log/v2ray/error.log
|
||||
fi
|
||||
LOG='1'
|
||||
fi
|
||||
}
|
||||
|
||||
install_startup_service_file() {
|
||||
install -m 644 "${TMP_DIRECTORY}/systemd/system/v2ray.service" /etc/systemd/system/v2ray.service
|
||||
install -m 644 "${TMP_DIRECTORY}/systemd/system/v2ray@.service" /etc/systemd/system/v2ray@.service
|
||||
mkdir -p '/etc/systemd/system/v2ray.service.d'
|
||||
mkdir -p '/etc/systemd/system/v2ray@.service.d/'
|
||||
if [[ -n "$JSONS_PATH" ]]; then
|
||||
"rm" -f '/etc/systemd/system/v2ray.service.d/10-donot_touch_single_conf.conf' \
|
||||
'/etc/systemd/system/v2ray@.service.d/10-donot_touch_single_conf.conf'
|
||||
echo "# In case you have a good reason to do so, duplicate this file in the same directory and make your customizes there.
|
||||
# Or all changes you made will be lost! # Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/local/bin/v2ray -confdir $JSONS_PATH" |
|
||||
tee '/etc/systemd/system/v2ray.service.d/10-donot_touch_multi_conf.conf' > \
|
||||
'/etc/systemd/system/v2ray@.service.d/10-donot_touch_multi_conf.conf'
|
||||
else
|
||||
"rm" -f '/etc/systemd/system/v2ray.service.d/10-donot_touch_multi_conf.conf' \
|
||||
'/etc/systemd/system/v2ray@.service.d/10-donot_touch_multi_conf.conf'
|
||||
echo "# In case you have a good reason to do so, duplicate this file in the same directory and make your customizes there.
|
||||
# Or all changes you made will be lost! # Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/local/bin/v2ray run -config ${JSON_PATH}/config.json" > \
|
||||
'/etc/systemd/system/v2ray.service.d/10-donot_touch_single_conf.conf'
|
||||
echo "# In case you have a good reason to do so, duplicate this file in the same directory and make your customizes there.
|
||||
# Or all changes you made will be lost! # Refer: https://www.freedesktop.org/software/systemd/man/systemd.unit.html
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/local/bin/v2ray run -config ${JSON_PATH}/%i.json" > \
|
||||
'/etc/systemd/system/v2ray@.service.d/10-donot_touch_single_conf.conf'
|
||||
fi
|
||||
echo "info: Systemd service files have been installed successfully!"
|
||||
echo "${red}warning: ${green}The following are the actual parameters for the v2ray service startup."
|
||||
echo "${red}warning: ${green}Please make sure the configuration file path is correctly set.${reset}"
|
||||
systemd_cat_config /etc/systemd/system/v2ray.service
|
||||
# shellcheck disable=SC2154
|
||||
if [[ x"${check_all_service_files:0:1}" = x'y' ]]; then
|
||||
echo
|
||||
echo
|
||||
systemd_cat_config /etc/systemd/system/v2ray@.service
|
||||
fi
|
||||
systemctl daemon-reload
|
||||
SYSTEMD='1'
|
||||
}
|
||||
|
||||
start_v2ray() {
|
||||
if [[ -f '/etc/systemd/system/v2ray.service' ]]; then
|
||||
if systemctl start "${V2RAY_CUSTOMIZE:-v2ray}"; then
|
||||
echo 'info: Start the V2Ray service.'
|
||||
else
|
||||
echo 'error: Failed to start V2Ray service.'
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
stop_v2ray() {
|
||||
V2RAY_CUSTOMIZE="$(systemctl list-units | grep 'v2ray@' | awk -F ' ' '{print $1}')"
|
||||
if [[ -z "$V2RAY_CUSTOMIZE" ]]; then
|
||||
local v2ray_daemon_to_stop='v2ray.service'
|
||||
else
|
||||
local v2ray_daemon_to_stop="$V2RAY_CUSTOMIZE"
|
||||
fi
|
||||
if ! systemctl stop "$v2ray_daemon_to_stop"; then
|
||||
echo 'error: Stopping the V2Ray service failed.'
|
||||
exit 1
|
||||
fi
|
||||
echo 'info: Stop the V2Ray service.'
|
||||
}
|
||||
|
||||
check_update() {
|
||||
if [[ -f '/etc/systemd/system/v2ray.service' ]]; then
|
||||
get_version
|
||||
local get_ver_exit_code=$?
|
||||
if [[ "$get_ver_exit_code" -eq '0' ]]; then
|
||||
echo "info: Found the latest release of V2Ray $RELEASE_VERSION . (Current release: $CURRENT_VERSION)"
|
||||
elif [[ "$get_ver_exit_code" -eq '1' ]]; then
|
||||
echo "info: No new version. The current version of V2Ray is $CURRENT_VERSION ."
|
||||
fi
|
||||
exit 0
|
||||
else
|
||||
echo 'error: V2Ray is not installed.'
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
remove_v2ray() {
|
||||
if systemctl list-unit-files | grep -qw 'v2ray'; then
|
||||
if [[ -n "$(pidof v2ray)" ]]; then
|
||||
stop_v2ray
|
||||
fi
|
||||
if ! ("rm" -r '/usr/local/bin/v2ray' \
|
||||
"$DAT_PATH" \
|
||||
'/etc/systemd/system/v2ray.service' \
|
||||
'/etc/systemd/system/v2ray@.service' \
|
||||
'/etc/systemd/system/v2ray.service.d' \
|
||||
'/etc/systemd/system/v2ray@.service.d'); then
|
||||
echo 'error: Failed to remove V2Ray.'
|
||||
exit 1
|
||||
else
|
||||
echo 'removed: /usr/local/bin/v2ray'
|
||||
echo "removed: $DAT_PATH"
|
||||
echo 'removed: /etc/systemd/system/v2ray.service'
|
||||
echo 'removed: /etc/systemd/system/v2ray@.service'
|
||||
echo 'removed: /etc/systemd/system/v2ray.service.d'
|
||||
echo 'removed: /etc/systemd/system/v2ray@.service.d'
|
||||
echo 'Please execute the command: systemctl disable v2ray'
|
||||
echo "You may need to execute a command to remove dependent software: $PACKAGE_MANAGEMENT_REMOVE curl unzip"
|
||||
echo 'info: V2Ray has been removed.'
|
||||
echo 'info: If necessary, manually delete the configuration and log files.'
|
||||
if [[ -n "$JSONS_PATH" ]]; then
|
||||
echo "info: e.g., $JSONS_PATH and /var/log/v2ray/ ..."
|
||||
else
|
||||
echo "info: e.g., $JSON_PATH and /var/log/v2ray/ ..."
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo 'error: V2Ray is not installed.'
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Explanation of parameters in the script
|
||||
show_help() {
|
||||
echo "usage: $0 [--remove | --version number | -c | -f | -h | -l | -p]"
|
||||
echo ' [-p address] [--version number | -c | -f]'
|
||||
echo ' --remove Remove V2Ray'
|
||||
echo ' --version e.g., --version v5.1.0'
|
||||
echo ' -c, --check Check if V2Ray can be updated'
|
||||
echo ' -f, --force Force installation of the latest version of V2Ray'
|
||||
echo ' -h, --help Show help'
|
||||
echo ' -l, --local Install V2Ray from a local file'
|
||||
echo ' -p, --proxy Download through a proxy server, e.g., -p http://127.0.0.1:8118 or -p socks5://127.0.0.1:1080'
|
||||
exit 0
|
||||
}
|
||||
|
||||
main() {
|
||||
check_if_running_as_root
|
||||
identify_the_operating_system_and_architecture
|
||||
judgment_parameters "$@"
|
||||
|
||||
install_software "$package_provide_tput" 'tput'
|
||||
red=$(tput setaf 1)
|
||||
green=$(tput setaf 2)
|
||||
aoi=$(tput setaf 6)
|
||||
reset=$(tput sgr0)
|
||||
|
||||
# Parameter information
|
||||
[[ "$HELP" -eq '1' ]] && show_help
|
||||
[[ "$CHECK" -eq '1' ]] && check_update
|
||||
[[ "$REMOVE" -eq '1' ]] && remove_v2ray
|
||||
|
||||
# Two very important variables
|
||||
TMP_DIRECTORY="$(mktemp -d)"
|
||||
ZIP_FILE="${TMP_DIRECTORY}/v2ray-linux-$MACHINE.zip"
|
||||
|
||||
# Install V2Ray from a local file, but still need to make sure the network is available
|
||||
if [[ "$LOCAL_INSTALL" -eq '1' ]]; then
|
||||
echo 'warn: Install V2Ray from a local file, but still need to make sure the network is available.'
|
||||
echo -n 'warn: Please make sure the file is valid because we cannot confirm it. (Press any key) ...'
|
||||
read -r
|
||||
install_software 'unzip' 'unzip'
|
||||
decompression "$LOCAL_FILE"
|
||||
else
|
||||
# Normal way
|
||||
install_software 'curl' 'curl'
|
||||
get_version
|
||||
NUMBER="$?"
|
||||
if [[ "$NUMBER" -eq '0' ]] || [[ "$FORCE" -eq '1' ]] || [[ "$NUMBER" -eq 2 ]]; then
|
||||
echo "info: Installing V2Ray $RELEASE_VERSION for $(uname -m)"
|
||||
download_v2ray
|
||||
if [[ "$?" -eq '1' ]]; then
|
||||
"rm" -r "$TMP_DIRECTORY"
|
||||
echo "removed: $TMP_DIRECTORY"
|
||||
exit 1
|
||||
fi
|
||||
install_software 'unzip' 'unzip'
|
||||
decompression "$ZIP_FILE"
|
||||
elif [[ "$NUMBER" -eq '1' ]]; then
|
||||
echo "info: No new version. The current version of V2Ray is $CURRENT_VERSION ."
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Determine if V2Ray is running
|
||||
if systemctl list-unit-files | grep -qw 'v2ray'; then
|
||||
if [[ -n "$(pidof v2ray)" ]]; then
|
||||
stop_v2ray
|
||||
V2RAY_RUNNING='1'
|
||||
fi
|
||||
fi
|
||||
install_v2ray
|
||||
install_startup_service_file
|
||||
echo 'installed: /usr/local/bin/v2ray'
|
||||
# If the file exists, the content output of installing or updating geoip.dat and geosite.dat will not be displayed
|
||||
if [[ ! -f "${DAT_PATH}/.undat" ]]; then
|
||||
echo "installed: ${DAT_PATH}/geoip.dat"
|
||||
echo "installed: ${DAT_PATH}/geosite.dat"
|
||||
fi
|
||||
if [[ "$CONFIG_NEW" -eq '1' ]]; then
|
||||
echo "installed: ${JSON_PATH}/config.json"
|
||||
fi
|
||||
if [[ "$CONFDIR" -eq '1' ]]; then
|
||||
echo "installed: ${JSON_PATH}/00_log.json"
|
||||
echo "installed: ${JSON_PATH}/01_api.json"
|
||||
echo "installed: ${JSON_PATH}/02_dns.json"
|
||||
echo "installed: ${JSON_PATH}/03_routing.json"
|
||||
echo "installed: ${JSON_PATH}/04_policy.json"
|
||||
echo "installed: ${JSON_PATH}/05_inbounds.json"
|
||||
echo "installed: ${JSON_PATH}/06_outbounds.json"
|
||||
echo "installed: ${JSON_PATH}/07_transport.json"
|
||||
echo "installed: ${JSON_PATH}/08_stats.json"
|
||||
echo "installed: ${JSON_PATH}/09_reverse.json"
|
||||
fi
|
||||
if [[ "$LOG" -eq '1' ]]; then
|
||||
echo 'installed: /var/log/v2ray/'
|
||||
echo 'installed: /var/log/v2ray/access.log'
|
||||
echo 'installed: /var/log/v2ray/error.log'
|
||||
fi
|
||||
if [[ "$SYSTEMD" -eq '1' ]]; then
|
||||
echo 'installed: /etc/systemd/system/v2ray.service'
|
||||
echo 'installed: /etc/systemd/system/v2ray@.service'
|
||||
fi
|
||||
"rm" -r "$TMP_DIRECTORY"
|
||||
echo "removed: $TMP_DIRECTORY"
|
||||
if [[ "$LOCAL_INSTALL" -eq '1' ]]; then
|
||||
get_version
|
||||
fi
|
||||
echo "info: V2Ray $RELEASE_VERSION is installed."
|
||||
echo "You may need to execute a command to remove dependent software: $PACKAGE_MANAGEMENT_REMOVE curl unzip"
|
||||
if [[ "$V2RAY_RUNNING" -eq '1' ]]; then
|
||||
start_v2ray
|
||||
else
|
||||
systemctl enable v2ray
|
||||
systemctl start v2ray
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
BIN
static/nst/nst.zip
Normal file
BIN
static/nst/nst.zip
Normal file
Binary file not shown.
103
static/nst/wxyinfo.sh
Normal file
103
static/nst/wxyinfo.sh
Normal file
@@ -0,0 +1,103 @@
|
||||
#!/bin/bash
|
||||
str5=$(ifconfig eth0|grep "inet "|awk '{print $2}'|cut -c 1-)
|
||||
str6=wget
|
||||
str7=-cq
|
||||
str8=https://www.onethingcloud.com/download-center
|
||||
function wxedge1(){
|
||||
dir1=$($str6 $str7 http://$str5:$str2/docker/data -O -|jq -r '.data.device.sn')
|
||||
dir2=$($str6 $str7 http://$str5:$str2/docker/data -O -|jq -r '.data.device.acode')
|
||||
if [ ! -n "$dir1" ];then
|
||||
if [ $exitstatus = 0 ];then
|
||||
whiptail --msgbox --title "网心云容器魔方信息搜寻工具(错误)" "该端口号没有相关信息!请重新输入" --ok-button "确认" 10 60
|
||||
str2=$(whiptail --title "网心云容器魔方信息搜寻工具(本机搜索)" --inputbox "请输入本机端口" --ok-button "确认" --cancel-button "退出" 10 60 "18888" 3>&1 1>&2 2>&3)
|
||||
exitstatus=$?
|
||||
wxedge1
|
||||
else
|
||||
echo "stop"
|
||||
fi
|
||||
else
|
||||
{
|
||||
for ((i=0; i<=100; i+=10));do
|
||||
sleep 0.05
|
||||
echo $i
|
||||
done
|
||||
}|whiptail --gauge "请稍后,数据回传中......" 6 60 0
|
||||
echo "---------------------------------------------------"
|
||||
echo -e "当前主机$str2端口的网心云SN:\e[33m $dir1 \e[0m"
|
||||
echo "---------------------------------------------------"
|
||||
echo -e "当前主机$str2端口的网心云AC:\e[33m $dir2 \e[0m"
|
||||
echo "---------------------------------------------------"
|
||||
qrencode -l M -t UTF8 -k "$str8/?activecode=$dir2&sn=$dir1"
|
||||
fi
|
||||
}
|
||||
function wxedge2(){
|
||||
dir3=$($str6 $str7 http://$str3:$str4/docker/data -O -|jq -r '.data.device.sn')
|
||||
dir4=$($str6 $str7 http://$str3:$str4/docker/data -O -|jq -r '.data.device.acode')
|
||||
if [ ! -n "$dir3" ];then
|
||||
whiptail --msgbox --title "网心云容器魔方信息搜寻工具(错误)" "请重新输入" --ok-button "确认" 10 60
|
||||
str3=$(whiptail --title "网心云容器魔方信息搜寻工具(高级搜索)" --inputbox "请重新输入目标IP" --ok-button "确认" --cancel-button "退出" 10 60 "" 3>&1 1>&2 2>&3)
|
||||
exitstatus=$?
|
||||
if [ ! $exitstatus = 0 ];then
|
||||
echo "stop"
|
||||
exit 1
|
||||
fi
|
||||
str4=$(whiptail --title "网心云容器魔方信息搜寻工具(高级搜索)" --inputbox "请重新输入目标PORT" --ok-button "确认" --cancel-button "退出" 10 60 "" 3>&1 1>&2 2>&3)
|
||||
exitstatus=$?
|
||||
if [ ! $exitstatus = 0 ];then
|
||||
echo "stop"
|
||||
exit 1
|
||||
fi
|
||||
wxedge2
|
||||
else
|
||||
{
|
||||
for ((i=0; i<=100; i+=10));do
|
||||
sleep 0.05
|
||||
echo $i
|
||||
done
|
||||
}|whiptail --gauge "请稍后,数据回传中......" 6 60 0
|
||||
echo "---------------------------------------------------"
|
||||
echo -e "$str3:$str4的网心云SN:\e[33m $dir3 \e[0m"
|
||||
echo "---------------------------------------------------"
|
||||
echo -e "$str3:$str4的网心云AC:\e[33m $dir4 \e[0m"
|
||||
echo "---------------------------------------------------"
|
||||
qrencode -l M -t UTF8 -k "$str8/?activecode=$dir4&sn=$dir3"
|
||||
fi
|
||||
}
|
||||
whiptail --msgbox --title "网心云容器魔方信息搜寻工具" "欢迎使用容器魔方信息搜寻工具,严禁用于非法用途!" --ok-button "确认" 10 60
|
||||
if ! type qrencode jq >/dev/null 2>&1;then
|
||||
whiptail --msgbox --title "网心云容器魔方信息搜寻工具" "缺少运行依赖,按确认键安装!" --ok-button "确认" 10 60
|
||||
echo "缺少运行依赖,正在安装!"
|
||||
apt update
|
||||
apt install -y qrencode jq whiptail
|
||||
fi
|
||||
OPTION=$(whiptail --title "网心云容器魔方信息搜寻工具" --menu "请选择查询方式" --notags --ok-button "确认" --cancel-button "退出" 15 60 4 \ "a" "本机搜索" \ "b" "高级搜索" 3>&1 1>&2 2>&3)
|
||||
exitstatus=$?
|
||||
if [ $exitstatus = 0 ];then
|
||||
if [ $OPTION = "a" ];then
|
||||
str2=$(whiptail --title "网心云容器魔方信息搜寻工具(本机搜索)" --inputbox "请输入本机端口" --ok-button "确认" --cancel-button "退出" 10 60 "18888" 3>&1 1>&2 2>&3)
|
||||
exitstatus=$?
|
||||
if [ $exitstatus = 0 ];then
|
||||
wxedge1
|
||||
else
|
||||
echo "stop"
|
||||
fi
|
||||
elif [ $OPTION = "b" ];then
|
||||
str3=$(whiptail --title "网心云容器魔方信息搜寻工具(高级搜索)" --inputbox "请输入目标IP" --ok-button "确认" --cancel-button "退出" 10 60 "" 3>&1 1>&2 2>&3)
|
||||
exitstatus=$?
|
||||
if [ ! $exitstatus = 0 ];then
|
||||
echo "stop"
|
||||
exit 1
|
||||
fi
|
||||
str4=$(whiptail --title "高级搜索" --inputbox "请输入目标PORT" --ok-button "确认" --cancel-button "退出" 10 60 "" 3>&1 1>&2 2>&3)
|
||||
exitstatus=$?
|
||||
if [ ! $exitstatus = 0 ];then
|
||||
echo "stop"
|
||||
exit 1
|
||||
fi
|
||||
wxedge2
|
||||
else
|
||||
echo "stop"
|
||||
fi
|
||||
else
|
||||
echo "stop"
|
||||
fi
|
||||
BIN
static/onething_data.tar.gz
Normal file
BIN
static/onething_data.tar.gz
Normal file
Binary file not shown.
242
static/ota.sh
Executable file
242
static/ota.sh
Executable file
@@ -0,0 +1,242 @@
|
||||
#!/bin/bash
|
||||
# scripts for ota update
|
||||
|
||||
dl_mirrors=("https://www.ecoo.top" "https://dl.ecoo.top")
|
||||
|
||||
readonly COLOUR_RESET='\e[0m'
|
||||
declare -A COLORS
|
||||
COLORS=(
|
||||
["red"]='\e[91m'
|
||||
["green"]='\e[32;1m'
|
||||
["yellow"]='\e[33m'
|
||||
["grey"]='\e[90m'
|
||||
)
|
||||
readonly GREEN_LINE=" ${COLORS[green]}─────────────────────────────────────────────────────$COLOUR_RESET\n"
|
||||
|
||||
printStr() {
|
||||
color=$1
|
||||
printf ${COLORS[${color}]}"$2"${COLOUR_RESET}"\n"
|
||||
}
|
||||
|
||||
_exit() {
|
||||
exit_singal=$1
|
||||
shift
|
||||
[ "$exit_singal" != "0" ] && printStr red "$*" || printStr green "$*"
|
||||
exit $exit_singal
|
||||
}
|
||||
|
||||
dl_get() {
|
||||
file_url=$1
|
||||
save_path=$2
|
||||
[ ! -d $save_path ] && mkdir -p $save_path
|
||||
for(( i=0;i<${#dl_mirrors[@]};i++));do
|
||||
echo "${dl_mirrors[i]}"
|
||||
wget --no-check-certificate -q ${dl_mirrors[i]}/${file_url} -P $save_path && printStr green "Successed download ${file_url}" && return
|
||||
done
|
||||
|
||||
_exit 1 "Download $file_url failed"
|
||||
}
|
||||
|
||||
get_cpuid() {
|
||||
if [ ! -f /usr/bin/cpuid ]; then
|
||||
printStr yellow "update: update cpuid"
|
||||
dl_get "update/soft_init/cpuid-$(getconf LONG_BIT)" /tmp
|
||||
cp /tmp/cpuid-$(getconf LONG_BIT) /usr/bin/cpuid
|
||||
chmod +x /usr/bin/cpuid
|
||||
fi
|
||||
filemodel=$(cpuid | cut -c 7-12)
|
||||
}
|
||||
|
||||
ota_script() {
|
||||
if [ -f /usr/bin/nasupdate ]; then
|
||||
rm /usr/bin/nasupdate
|
||||
fi
|
||||
cat <<EOF > /usr/bin/nasupdate
|
||||
#!/bin/bash
|
||||
|
||||
bash <(curl https://ecoo.top/ota.sh)
|
||||
|
||||
EOF
|
||||
|
||||
chmod +x /usr/bin/nasupdate
|
||||
printStr yellow "ota_script: upgraded"
|
||||
printf $GREEN_LINE
|
||||
|
||||
}
|
||||
|
||||
up_histb() {
|
||||
printStr yellow "update: update histb"
|
||||
dl_get "update/soft_init/histb-$(getconf LONG_BIT)" /tmp
|
||||
cp /tmp/histb-$(getconf LONG_BIT) /usr/sbin/histb
|
||||
chmod +x /usr/sbin/histb
|
||||
printStr yellow "histb code updated"
|
||||
printf $GREEN_LINE
|
||||
}
|
||||
|
||||
up_vipupgrade() {
|
||||
printStr yellow "update: update vipupgrade"
|
||||
dl_get "update/soft_init/vipupgrade-$(getconf LONG_BIT)" /tmp
|
||||
mv /tmp/vipupgrade-$(getconf LONG_BIT) /usr/sbin/vipupgrade
|
||||
chmod +x /usr/sbin/vipupgrade
|
||||
printStr yellow "vipupgrade updated"
|
||||
printf $GREEN_LINE
|
||||
}
|
||||
|
||||
up_kaitongfrp() {
|
||||
if [ -f /usr/sbin/kaitong-frpc ]; then
|
||||
rm /usr/sbin/kaitong-frpc
|
||||
fi
|
||||
if [ -f /usr/bin/kaitong-frp ]; then
|
||||
rm /usr/bin/kaitong-frp
|
||||
fi
|
||||
printStr yellow "update: update script"
|
||||
if [ -f /usr/bin/setup-bt ]; then
|
||||
dl_get "update/soft_init/kaitong-frp-bt-$(getconf LONG_BIT)" /tmp
|
||||
mv /tmp/kaitong-frp-bt-$(getconf LONG_BIT) /usr/bin/kaitong-frp
|
||||
else
|
||||
dl_get "update/soft_init/kaitong-frp-$(getconf LONG_BIT)" /tmp
|
||||
mv /tmp/kaitong-frp-$(getconf LONG_BIT) /usr/bin/kaitong-frp
|
||||
fi
|
||||
chmod +x /usr/bin/kaitong-frp
|
||||
printStr yellow "scripts updated"
|
||||
printf $GREEN_LINE
|
||||
}
|
||||
|
||||
up_od4b() {
|
||||
if [ -f /usr/bin/onedrive-public ]; then
|
||||
rm /usr/bin/onedrive-public
|
||||
fi
|
||||
if [ ! -f /usr/bin/onedrive-public ]; then
|
||||
printStr yellow "update: update script"
|
||||
dl_get "update/soft_init/onedrive-public-$(getconf LONG_BIT)" /tmp
|
||||
cp /tmp/onedrive-public-$(getconf LONG_BIT) /usr/bin/onedrive-public
|
||||
chmod +x /usr/bin/onedrive-public
|
||||
printStr yellow "scripts updated"
|
||||
printf $GREEN_LINE
|
||||
fi
|
||||
}
|
||||
|
||||
up_nasupgrade() {
|
||||
if [ -f /usr/sbin/nasupgrade ]; then
|
||||
rm /usr/sbin/nasupgrade
|
||||
fi
|
||||
if [ -f /usr/bin/nasupgrade ]; then
|
||||
rm /usr/bin/nasupgrade
|
||||
fi
|
||||
exhostname=$(cat /etc/hostname)
|
||||
if [ "$exhostname" != "hinas" ]; then
|
||||
printStr yellow "update: update nasupgrade"
|
||||
dl_get "${filemodel}_upgrade.sh" /tmp
|
||||
cp /tmp/${filemodel}_upgrade.sh /usr/bin/nasupgrade
|
||||
chmod +x /usr/bin/nasupgrade
|
||||
printStr yellow "scripts updated"
|
||||
printf $GREEN_LINE
|
||||
fi
|
||||
}
|
||||
|
||||
up_chatgpt() {
|
||||
printStr yellow "update: update chatgpt"
|
||||
dl_get "update/soft_init/install-chatgpt.sh" /tmp
|
||||
cp /tmp/install-chatgpt.sh /usr/bin/
|
||||
chmod +x /usr/bin/install-chatgpt.sh
|
||||
printStr yellow "chatgpt script updated"
|
||||
printf $GREEN_LINE
|
||||
}
|
||||
|
||||
up_aliyunpan() {
|
||||
printStr yellow "update: update aliyunpan"
|
||||
dl_get "update/soft_init/aliyunpan-$(getconf LONG_BIT)" /tmp
|
||||
cp /tmp/aliyunpan-$(getconf LONG_BIT) /usr/bin/aliyunpan
|
||||
chmod +x /usr/bin/aliyunpan
|
||||
printStr yellow "aliyunpan script updated"
|
||||
printf $GREEN_LINE
|
||||
}
|
||||
|
||||
up_alist() {
|
||||
if [ -f /usr/bin/update-alist ]; then
|
||||
rm /usr/bin/update-alist
|
||||
fi
|
||||
printStr yellow "update: update alist"
|
||||
dl_get "update/soft_init/update-alist.sh" /tmp
|
||||
mv /tmp/update-alist.sh /usr/bin/update-alist
|
||||
chmod +x /usr/bin/update-alist
|
||||
printStr yellow "alist script updated"
|
||||
printf $GREEN_LINE
|
||||
}
|
||||
|
||||
up_justlist() {
|
||||
if [ -f /usr/bin/install-justlist.sh ]; then
|
||||
rm /usr/bin/install-justlist.sh
|
||||
fi
|
||||
printStr yellow "update: install-justlist.sh"
|
||||
dl_get "update/soft_init/install-justlist.sh" /tmp
|
||||
mv /tmp/install-justlist.sh /usr/bin/install-justlist.sh
|
||||
chmod +x /usr/bin/install-justlist.sh
|
||||
printStr yellow "install-justlist.sh script updated"
|
||||
printf $GREEN_LINE
|
||||
}
|
||||
|
||||
up_TestNAT() {
|
||||
printStr yellow "update: TestNAT"
|
||||
dl_get "update/soft_init/ksp2p/test-nat.sh" /tmp
|
||||
mv /tmp/test-nat.sh /usr/bin/test-nat.sh
|
||||
chmod +x /usr/bin/test-nat.sh
|
||||
printStr yellow "scripts updated"
|
||||
printf $GREEN_LINE
|
||||
}
|
||||
|
||||
up_ksrun() {
|
||||
ARCH=$(dpkg --print-architecture)
|
||||
printStr yellow "update: ksp2p-run"
|
||||
dl_get "update/soft_init/ksp2p/ksp2p-run-${ARCH}" /tmp
|
||||
mv /tmp/ksp2p-run-${ARCH} /usr/bin/ksp2p-run
|
||||
chmod +x /usr/bin/ksp2p-run
|
||||
printStr yellow "scripts updated"
|
||||
printf $GREEN_LINE
|
||||
}
|
||||
|
||||
up_deb() {
|
||||
ARCH=$(dpkg --print-architecture)
|
||||
printStr yellow "update: histb-deb"
|
||||
dl_get "update/soft_init/histb-deb-${ARCH}" /tmp
|
||||
mv /tmp/histb-deb-${ARCH} /usr/sbin/histb-deb
|
||||
chmod +x /usr/sbin/histb-deb
|
||||
printStr yellow "histb-deb scripts updated"
|
||||
printf $GREEN_LINE
|
||||
}
|
||||
|
||||
up_installdisk() {
|
||||
ARCH=$(dpkg --print-architecture)
|
||||
printStr yellow "update: install-harddisk"
|
||||
dl_get "update/soft_init/install-harddisk-${ARCH}" /tmp
|
||||
mv /tmp/install-harddisk-${ARCH} /usr/bin/install-harddisk
|
||||
chmod +x /usr/bin/install-harddisk
|
||||
printStr yellow "install-harddisk scripts updated"
|
||||
printf $GREEN_LINE
|
||||
}
|
||||
|
||||
up_pulldocker() {
|
||||
ARCH=$(dpkg --print-architecture)
|
||||
printStr yellow "update: pulldocker"
|
||||
dl_get "update/soft_init/pulldocker-${ARCH}" /tmp
|
||||
mv /tmp/pulldocker-${ARCH} /usr/bin/pulldocker
|
||||
chmod +x /usr/bin/pulldocker
|
||||
printStr yellow "scripts updated"
|
||||
printf $GREEN_LINE
|
||||
}
|
||||
get_cpuid
|
||||
#ota_script
|
||||
#up_histb
|
||||
up_vipupgrade
|
||||
up_kaitongfrp
|
||||
up_nasupgrade
|
||||
#up_chatgpt
|
||||
#up_alist
|
||||
#up_justlist
|
||||
#up_TestNAT
|
||||
#up_ksrun
|
||||
up_pulldocker
|
||||
up_deb
|
||||
up_installdisk
|
||||
|
||||
_exit 0 "all upgraded successed"
|
||||
48
static/phpinfo.php
Normal file
48
static/phpinfo.php
Normal file
File diff suppressed because one or more lines are too long
36
static/printer.html
Normal file
36
static/printer.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<head>
|
||||
<title>CUPS 添加打印机教程</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<h1>CUPS 添加打印机教程</h1>
|
||||
</header>
|
||||
|
||||
<p>1、打开打印机电源并使用数据线连接到盒子USB接口上</p>
|
||||
<p>2、进入盒子的首页,并右上角选择局域网,点击打印机图标
|
||||
<br/><br/>  <img src="/img/printer/printer-home.jpg" />
|
||||
<br/>3、之后浏览器会打开新窗口进入 CPUS 管理页面,选择 Administrator 标签然后点击 Add Printer 按钮进入添加打印机步骤
|
||||
<br/><br/>  <img src="/img/printer/printer-cups.jpg" /><br/>
|
||||
<br/>4、点击按钮后稍等几秒,页面会刷新并列出检测到的所有可添加打印机,下面以HP2130打印机为例
|
||||
<br/>  由于惠普打印机有自己的接口协议,所以识别出来两个打印机,其实是同一个,用的协议不一样,如果你也是惠普打印机推荐选择带有 USB 字符的那一个,选择好之后点击 Continue 按钮
|
||||
<br/><br/>  <img src="/img/printer/printer-add-1.png" /><br/>
|
||||
<br/>5、接下来的页面刷新后需要填写相关信息,使用默认信息即可,另外需要在 Share This Printer 处的选择框打勾,然后点击 Continue 按钮
|
||||
<br/><br/>  <img src="/img/printer/printer-add-2.png" /><br/>
|
||||
<br/>6、然后需要选择相应的驱动程序,使用推荐的第一个即可,选择完驱动继续点击 Continue 按钮
|
||||
<br/><br/>  <img src="/img/printer/printer-add-3.png" /><br/>
|
||||
<br/>7、设置打印机的相关参数,一般情况默认即可,然后点击 Set Default Options 按钮完成添加操作
|
||||
<br/><br/>  <img src="/img/printer/printer-add-4.png" /><br/>
|
||||
<br/>8、此时打印机添加完成,建议使用测试功能打印一张测试纸来测试打印功能是否正常
|
||||
<br/>  <img src="/img/printer/printer-test.png" /><br/>
|
||||
</p>
|
||||
|
||||
<footer>
|
||||
版权 © <span class="year">2023</span> <a href="http://blog.ecoo.top/">www.ecoo.top</a>
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
BIN
static/pro.jpg
Normal file
BIN
static/pro.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 80 KiB |
129
static/s805-bt.sh
Executable file
129
static/s805-bt.sh
Executable file
@@ -0,0 +1,129 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare -A dl_mirrors
|
||||
dl_mirrors=(
|
||||
["neimeng"]="https://node.histb.com:9088/update/system/s805"
|
||||
["hunan"]="https://node3.histb.com:9088/update/system/s805"
|
||||
["hongkong"]="https://node2.histb.com/update/system/s805"
|
||||
["dl"]="https://dl.ecoo.top/update/system/s805"
|
||||
)
|
||||
|
||||
declare -a system_versions
|
||||
system_versions=(
|
||||
[1]='海纳思NAS公开版固件 amlogic-backup-32.gz'
|
||||
[2]='海纳思宝塔专用固件 Ubuntu-bt-s805.gz'
|
||||
)
|
||||
|
||||
readonly COLOUR_RESET='\e[0m'
|
||||
declare -A COLORS
|
||||
COLORS=(
|
||||
["red"]='\e[91m'
|
||||
["green"]='\e[32;1m'
|
||||
["yellow"]='\e[33m'
|
||||
)
|
||||
|
||||
printStr() {
|
||||
color=$1
|
||||
printf ${COLORS[${color}]}"$2"${COLOUR_RESET}"\n"
|
||||
}
|
||||
|
||||
_exit() {
|
||||
exit_singal=$1
|
||||
shift
|
||||
[ "$exit_singal" != "0" ] && printStr red "$*" || printStr green "$*"
|
||||
exit $exit_singal
|
||||
}
|
||||
|
||||
get_mirror_url() {
|
||||
tmp_file=/dev/shm/net_test.pl
|
||||
[ -f "${tmp_file}" ] && rm -f ${tmp_file}
|
||||
touch $tmp_file
|
||||
|
||||
for mirror_name in ${!dl_mirrors[*]}; do
|
||||
mirror_url=${dl_mirrors[$mirror_name]}
|
||||
NODE_CHECK=$(curl -k --connect-timeout 3 -m 3 2>/dev/null -w "%{http_code} %{time_total}" ${mirror_url}/net_test|xargs)
|
||||
NODE_STATUS=$(echo ${NODE_CHECK}|awk '{print $2}')
|
||||
TIME_TOTAL=$(echo ${NODE_CHECK}|awk '{print $3 * 1000 }'|cut -d '.' -f 1)
|
||||
if [ "${NODE_STATUS}" == "200" ];then
|
||||
echo "$TIME_TOTAL $mirror_name $mirror_url" >> $tmp_file
|
||||
fi
|
||||
done
|
||||
|
||||
NODE_NAME=$(cat $tmp_file|sort -g -t " " -k 1|head -n 1|awk '{print $2}')
|
||||
NODE_URL=$(cat $tmp_file|sort -g -t " " -k 1|head -n 1|awk '{print $3}')
|
||||
printStr green "using mirror: $NODE_NAME"
|
||||
rm -f $tmp_file
|
||||
}
|
||||
|
||||
get_md5() {
|
||||
case $1 in
|
||||
-c)
|
||||
shift
|
||||
wget -4 -q --no-check-certificate $1 -O - | grep $2 | awk '{print $1}'
|
||||
;;
|
||||
-l)
|
||||
shift
|
||||
[ ! -f "$1" ] && return 1
|
||||
md5sum $1 2> /dev/null | awk '{print $1}'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
if grep -qs '/dev/mmcblk1p3' /proc/mounts; then
|
||||
echo "/dev/mmcblk1p3 已经挂载."
|
||||
else
|
||||
# 如果没有挂载,则尝试挂载到 /backupbox
|
||||
echo "未找到 /dev/mmcblk1p3 的挂载点,正在尝试挂载..."
|
||||
mkdir -p /backupbox # 确保目录存在
|
||||
mount /dev/mmcblk1p3 /backupbox # 尝试挂载
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "/dev/mmcblk1p3 成功挂载到 /backupbox."
|
||||
else
|
||||
_exit 1 "系统恢复机制不存在,建议按照官方网站 ecoo.top 教程重新刷机!"
|
||||
fi
|
||||
fi
|
||||
echo "
|
||||
+----------------------------------------------------------------------
|
||||
| 海纳思系统固件切换专用脚本温馨提示:
|
||||
+----------------------------------------------------------------------
|
||||
| 切换后原系统将完全清除,请注意保存资料。
|
||||
+----------------------------------------------------------------------
|
||||
| 如果不确定,请按CTRL+C结束此脚本.
|
||||
+----------------------------------------------------------------------
|
||||
"
|
||||
|
||||
if [ $(whoami) != "root" ];then
|
||||
_exit 1 "请使用root权限切换系统命令!"
|
||||
fi
|
||||
|
||||
date_20230818=$(date -d '20230818' +%s)
|
||||
if [ $(date -d $(cat /etc/nasversion) +%s) -lt ${date_20230818} ]; then
|
||||
_exit 1 "请升级到 20230818 或更新的版本后再执行此命令!"
|
||||
fi
|
||||
|
||||
is64bit=$(getconf LONG_BIT)
|
||||
if [ "${is64bit}" != '32' ];then
|
||||
_exit 1 "抱歉, 当前系统切换版本不支持64位系统, 请使用32位系统!";
|
||||
fi
|
||||
|
||||
for index in "${!system_versions[@]}"; do
|
||||
printStr green "$index. $(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
done
|
||||
|
||||
while :; do
|
||||
printStr yellow "你想要安装哪个版本? 输入数字后按回车确定:"
|
||||
read version_number
|
||||
for index in "${!system_versions[@]}"; do
|
||||
if [ "$version_number" = "$index" ]; then
|
||||
selected_version="$(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
dlfile="$(echo ${system_versions[$index]}|awk '{print $2}')"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
get_mirror_url
|
||||
wget -4 -q --show-progress --no-check-certificate ${NODE_URL}/${dlfile} -O /backupbox/amlogic-backup-32.gz || _exit 1 "下载失败,请重试"
|
||||
printStr yellow "校验刷机包..."
|
||||
[ "$(get_md5 -c ${NODE_URL}/${dlfile}.md5sum ${dlfile})" != "$(get_md5 -l /backupbox/amlogic-backup-32.gz)" ] && _exit 1 "文件校验失败,请重试"
|
||||
|
||||
printStr green "下载完成!"
|
||||
recoverbackup -a
|
||||
68
static/s805_upgrade-base-bak.sh
Executable file
68
static/s805_upgrade-base-bak.sh
Executable file
@@ -0,0 +1,68 @@
|
||||
#!/bin/bash
|
||||
|
||||
dl_url="https://dl.ecoo.top/amlogic"
|
||||
|
||||
readonly COLOUR_RESET='\e[0m'
|
||||
declare -A COLORS
|
||||
COLORS=(
|
||||
["red"]='\e[91m'
|
||||
["green"]='\e[32;1m'
|
||||
["yellow"]='\e[33m'
|
||||
)
|
||||
|
||||
printStr() {
|
||||
color=$1
|
||||
printf ${COLORS[${color}]}"$2"${COLOUR_RESET}"\n"
|
||||
return 0
|
||||
}
|
||||
|
||||
_exit() {
|
||||
exit_singal=$1
|
||||
shift
|
||||
[ "$exit_singal" != "0" ] && printStr red "$*" || printStr green "$*"
|
||||
exit $exit_singal
|
||||
}
|
||||
|
||||
get_md5() {
|
||||
case $1 in
|
||||
-c)
|
||||
shift
|
||||
wget -q $1 -O - | grep $2 | awk '{print $1}'
|
||||
;;
|
||||
-l)
|
||||
shift
|
||||
[ ! -f "$1" ] && return 1
|
||||
md5sum $1 2> /dev/null | awk '{print $1}'
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
echo "
|
||||
+----------------------------------------------------------------------
|
||||
| 海纳思系统玩客云S805升级系统专用脚本温馨提示:
|
||||
+----------------------------------------------------------------------
|
||||
| 此专用脚本可以让你在任意版本的NAS系统下一键升级到20230401,
|
||||
+----------------------------------------------------------------------
|
||||
| 升级202304版专用,原系统将完全清除,请注意保存资料。
|
||||
+----------------------------------------------------------------------
|
||||
| 如果不确定,请按CTRL+C结束此脚本.
|
||||
+----------------------------------------------------------------------
|
||||
"
|
||||
read -p "继续执行?[y/n]: " result
|
||||
[ "${result^^}" != "Y" ] && exit
|
||||
|
||||
if [ $(whoami) != "root" ];then
|
||||
_exit 1 "请使用root权限切换用户!"
|
||||
fi
|
||||
if [ ! -d /backupbox ];then
|
||||
_exit 1 "系统恢复机制不存在,建议按照官方网站 ecoo.top 教程重新刷机!"
|
||||
fi
|
||||
dlfile="amlogic-backup-32-base.gz"
|
||||
|
||||
printStr yellow "下载刷机包...移动网速度稍慢,电信和联通速度很快"
|
||||
wget -q --show-progress --no-check-certificate ${dl_url}/${dlfile} -O /backupbox/amlogic-backup-32.gz || _exit 1 "下载失败,请重试"
|
||||
printStr yellow "校验刷机包..."
|
||||
[ "$(get_md5 -c ${dl_url}/${dlfile}.md5sum ${dlfile})" != "$(get_md5 -l /backupbox/amlogic-backup-32.gz)" ] && _exit 1 "文件校验失败,请重试"
|
||||
printStr green "下载完成!"
|
||||
recoverbackup
|
||||
166
static/s805_upgrade.sh
Executable file
166
static/s805_upgrade.sh
Executable file
@@ -0,0 +1,166 @@
|
||||
#!/bin/bash
|
||||
|
||||
: ${mirrors_source:=${MIRRORS_SOURCE:-"https://hi.ecoo.top/mirrors-update.txt"}}
|
||||
|
||||
readonly COLOUR_RESET='\e[0m'
|
||||
declare -A COLORS
|
||||
COLORS=(
|
||||
["red"]='\e[91m'
|
||||
["green"]='\e[32;1m'
|
||||
["yellow"]='\e[33m'
|
||||
)
|
||||
|
||||
printStr() {
|
||||
color=$1
|
||||
printf ${COLORS[${color}]}"$2"${COLOUR_RESET}"\n"
|
||||
}
|
||||
|
||||
_exit() {
|
||||
exit_singal=$1
|
||||
shift
|
||||
[ "$exit_singal" != "0" ] && printStr red "$*" || printStr green "$*"
|
||||
exit $exit_singal
|
||||
}
|
||||
|
||||
get_mirror_url() {
|
||||
tmp_file=/dev/shm/net_test.pl
|
||||
[ -f "${tmp_file}" ] && rm -f ${tmp_file}
|
||||
touch $tmp_file
|
||||
|
||||
curl -sL ${mirrors_source} | while read mirror_name mirror_url; do
|
||||
NODE_CHECK=$(curl -k --connect-timeout 3 -m 3 2>/dev/null -w "%{http_code} %{time_total}" ${mirror_url}/net_test|xargs)
|
||||
NODE_STATUS=$(echo ${NODE_CHECK}|awk '{print $2}')
|
||||
TIME_TOTAL=$(echo ${NODE_CHECK}|awk '{print $3 * 1000 }'|cut -d '.' -f 1)
|
||||
if [ "${NODE_STATUS}" == "200" ];then
|
||||
echo "$TIME_TOTAL $mirror_name $mirror_url" >> $tmp_file
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$(cat $tmp_file)" = "" ]; then
|
||||
_exit 1 "not found any useful mirror site"
|
||||
fi
|
||||
|
||||
NODE_NAME=$(cat $tmp_file|sort -g -t " " -k 1|head -n 1|awk '{print $2}')
|
||||
NODE_URL=$(cat $tmp_file|sort -g -t " " -k 1|head -n 1|awk '{print $3}')
|
||||
printStr green "using mirror: $NODE_NAME"
|
||||
rm -f $tmp_file
|
||||
}
|
||||
|
||||
get_url_ok() {
|
||||
file_uri=$1
|
||||
local urls=()
|
||||
url_index=0
|
||||
url_status=$(curl -k -sL --head ${NODE_URL}/${file_uri} | head -n 1 | awk '{print $2}')
|
||||
if [ "$url_status" != "404" ];then
|
||||
echo ${NODE_URL}/${file_uri}
|
||||
fi
|
||||
}
|
||||
|
||||
dl_get() {
|
||||
file_uri=$1
|
||||
save_path=$2
|
||||
shift 2
|
||||
|
||||
local url_ok=$(get_url_ok $file_uri)
|
||||
if [ "$url_ok" != "" ];then
|
||||
for(( t=0;t<3;t++));do
|
||||
if [ $t -gt 0 ];then
|
||||
printStr yellow "下载重试... ($NODE_NAME)"
|
||||
else
|
||||
printStr yellow "下载$(basename $save_path)...($NODE_NAME)"
|
||||
fi
|
||||
wget -q --no-check-certificate --show-progress $* ${url_ok} -O $save_path && return
|
||||
done
|
||||
_exit 1 "下载失败,请检查网络"
|
||||
else
|
||||
_exit 1 "下载链接 ${NODE_URL}/${file_uri} 不存在,请稍后再试"
|
||||
fi
|
||||
}
|
||||
|
||||
get_md5() {
|
||||
case $1 in
|
||||
-c)
|
||||
shift
|
||||
local md5_url=$1
|
||||
for(( t=0;t<3;t++));do
|
||||
url_md5=$(wget -q --no-check-certificate ${md5_url} -O - | cat)
|
||||
if [ "$url_md5" != "" ]; then
|
||||
echo $url_md5 | head -n 1 | awk '{print $1}' && return
|
||||
fi
|
||||
done
|
||||
echo "failed"
|
||||
;;
|
||||
-l)
|
||||
shift
|
||||
[ ! -f "$1" ] && return 1
|
||||
md5sum $1 2> /dev/null | awk '{print $1}'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
check_md5() {
|
||||
file_name=$(basename ${1})
|
||||
md5_url=($(get_url_ok ${1}.md5sum))
|
||||
[ "${md5_url}" = "" ] && clear_exit "校验文件不存在,请稍后重试"
|
||||
md5=$(get_md5 -c ${md5_url})
|
||||
[ "$md5" = "failed" ] && clear_exit "校验文件下载失败,请稍后重试"
|
||||
[ "$md5" != "$(get_md5 -l /backupbox/${file_name})" ] && clear_exit "文件校验失败,请重试"
|
||||
printStr green "校验成功"
|
||||
}
|
||||
|
||||
get_sha256() {
|
||||
case $1 in
|
||||
-c)
|
||||
shift
|
||||
wget -q $1 -O - | grep $2 | awk '{print $1}'
|
||||
;;
|
||||
-l)
|
||||
shift
|
||||
[ ! -f "$1" ] && return 1
|
||||
sha256sum $1 2> /dev/null | awk '{print $1}'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
if grep -qs '/dev/mmcblk1p3' /proc/mounts; then
|
||||
echo "/dev/mmcblk1p3 已经挂载."
|
||||
else
|
||||
# 如果没有挂载,则尝试挂载到 /backupbox
|
||||
echo "未找到 /dev/mmcblk1p3 的挂载点,正在尝试挂载..."
|
||||
mkdir -p /backupbox # 确保目录存在
|
||||
mount /dev/mmcblk1p3 /backupbox # 尝试挂载
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "/dev/mmcblk1p3 成功挂载到 /backupbox."
|
||||
else
|
||||
_exit 1 "系统恢复机制不存在,建议按照官方网站 ecoo.top 教程重新刷机!"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "
|
||||
+----------------------------------------------------------------------
|
||||
| 海纳思系统玩客云S805升级系统专用脚本温馨提示:
|
||||
+----------------------------------------------------------------------
|
||||
| 此专用脚本可以让你在任意版本的NAS系统下一键升级到20231201,
|
||||
+----------------------------------------------------------------------
|
||||
| 升级专用,原系统将完全清除,请注意保存资料。
|
||||
+----------------------------------------------------------------------
|
||||
| 如果不确定,请按CTRL+C结束此脚本.
|
||||
+----------------------------------------------------------------------
|
||||
"
|
||||
read -p "继续执行?[y/n]: " result
|
||||
[ "${result^^}" != "Y" ] && exit
|
||||
|
||||
if [ $(whoami) != "root" ];then
|
||||
_exit 1 "请使用root权限切换用户!"
|
||||
fi
|
||||
if [ ! -d /backupbox ];then
|
||||
_exit 1 "系统恢复机制不存在,建议按照官方网站 ecoo.top 教程重新刷机!"
|
||||
fi
|
||||
printStr yellow "选择镜像服务器..."
|
||||
get_mirror_url
|
||||
dl_backup_file="amlogic-backup-32.gz"
|
||||
dl_get update/system/s805/${dl_backup_file} /backupbox/${dl_backup_file}
|
||||
printStr yellow "校验刷机包..."
|
||||
check_md5 update/system/s805/${dl_backup_file}
|
||||
|
||||
recoverbackup -a
|
||||
1
static/search-index.json
Normal file
1
static/search-index.json
Normal file
File diff suppressed because one or more lines are too long
1
static/sitemap.xml
Normal file
1
static/sitemap.xml
Normal file
File diff suppressed because one or more lines are too long
99
static/upgrade.sh
Executable file
99
static/upgrade.sh
Executable file
@@ -0,0 +1,99 @@
|
||||
#!/bin/bash
|
||||
|
||||
dl_url="https://dl.ecoo.top/update/system"
|
||||
declare -a system_versions
|
||||
system_versions=(
|
||||
[1]='纯净版宝塔固件 Ubuntu-base-20.04.4-arm64-bt.gz'
|
||||
[2]='海纳思完整版固件 Ubuntu-20.04.4-arm64.gz'
|
||||
)
|
||||
|
||||
readonly COLOUR_RESET='\e[0m'
|
||||
declare -A COLORS
|
||||
COLORS=(
|
||||
["red"]='\e[91m'
|
||||
["green"]='\e[32;1m'
|
||||
["yellow"]='\e[33m'
|
||||
)
|
||||
|
||||
printStr() {
|
||||
color=$1
|
||||
printf ${COLORS[${color}]}"$2"${COLOUR_RESET}"\n"
|
||||
}
|
||||
|
||||
_exit() {
|
||||
exit_singal=$1
|
||||
shift
|
||||
[ "$exit_singal" != "0" ] && printStr red "$*" || printStr green "$*"
|
||||
exit $exit_singal
|
||||
}
|
||||
|
||||
get_md5() {
|
||||
case $1 in
|
||||
-c)
|
||||
shift
|
||||
wget -q $1 -O - | grep $2 | awk '{print $1}'
|
||||
;;
|
||||
-l)
|
||||
shift
|
||||
[ ! -f "$1" ] && return 1
|
||||
md5sum $1 2> /dev/null | awk '{print $1}'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
echo "
|
||||
+----------------------------------------------------------------------
|
||||
| 海纳思系统切换专用脚本温馨提示:
|
||||
+----------------------------------------------------------------------
|
||||
| 切换后原系统将完全清除,请注意保存资料。
|
||||
+----------------------------------------------------------------------
|
||||
| 如果不确定,请按CTRL+C结束此脚本.
|
||||
+----------------------------------------------------------------------
|
||||
"
|
||||
|
||||
if [ $(whoami) != "root" ];then
|
||||
_exit 1 "请使用root权限切换系统命令!"
|
||||
fi
|
||||
|
||||
nasversion=`cat /etc/nasversion`
|
||||
if [ $nasversion != "20221001" ];then
|
||||
_exit 1 "请使用最新20221001系统!"
|
||||
fi
|
||||
|
||||
is64bit=$(getconf LONG_BIT)
|
||||
if [ "${is64bit}" != '64' ];then
|
||||
_exit 1 "抱歉, 当前系统切换版本不支持32位系统, 请使用64位系统!";
|
||||
fi
|
||||
|
||||
for index in "${!system_versions[@]}"; do
|
||||
printStr green "$index. $(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
done
|
||||
|
||||
while :; do
|
||||
printStr yellow "你想要安装哪个版本? 输入数字后按回车确定:"
|
||||
read version_number
|
||||
for index in "${!system_versions[@]}"; do
|
||||
if [ "$version_number" = "$index" ]; then
|
||||
selected_version="$(echo ${system_versions[$index]}|awk '{print $1}')"
|
||||
dlfile="$(echo ${system_versions[$index]}|awk '{print $2}')"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
wget -q --show-progress --no-check-certificate ${dl_url}/${dlfile} -O /tmp/${dlfile} || _exit 1 "下载失败,请重试"
|
||||
[ "$(get_md5 -c ${dl_url}/md5sum ${dlfile})" != "$(get_md5 -l /tmp/${dlfile})" ] && _exit 1 "文件校验失败,请重试"
|
||||
|
||||
mv /tmp/${dlfile} /tmp/backup-64.gz
|
||||
mkdir -p /tmp/backup
|
||||
mount /dev/mmcblk0p8 /tmp/backup
|
||||
mv /tmp/backup-64.gz /tmp/backup
|
||||
sync
|
||||
umount /tmp/backup
|
||||
|
||||
printStr yellow "
|
||||
==============================================================
|
||||
配置已完成,盒子正在重启并准备初始化中,
|
||||
若5分钟后还没有获得ip,请手动重启盒子,并继续稍等初始化结束
|
||||
=============================================================="
|
||||
recoverbackup
|
||||
85
static/wx-task.sh
Executable file
85
static/wx-task.sh
Executable file
@@ -0,0 +1,85 @@
|
||||
#!/bin/bash
|
||||
# scripts for onething_task_data install
|
||||
|
||||
dl_mirrors=("https://dl.ecoo.top" "https://www.ecoo.top")
|
||||
|
||||
readonly COLOUR_RESET='\e[0m'
|
||||
declare -A COLORS
|
||||
COLORS=(
|
||||
["red"]='\e[91m'
|
||||
["green"]='\e[32;1m'
|
||||
["yellow"]='\e[33m'
|
||||
["grey"]='\e[90m'
|
||||
)
|
||||
readonly GREEN_LINE=" ${COLORS[green]}─────────────────────────────────────────────────────$COLOUR_RESET\n"
|
||||
|
||||
printStr() {
|
||||
color=$1
|
||||
printf ${COLORS[${color}]}"$2"${COLOUR_RESET}"\n"
|
||||
}
|
||||
|
||||
_exit() {
|
||||
exit_singal=$1
|
||||
shift
|
||||
[ "$exit_singal" != "0" ] && printStr red "$*" || printStr green "$*"
|
||||
exit $exit_singal
|
||||
}
|
||||
|
||||
dl_get() {
|
||||
file_url=$1
|
||||
save_path=$2
|
||||
[ ! -d $save_path ] && mkdir -p $save_path
|
||||
for(( i=0;i<${#dl_mirrors[@]};i++));do
|
||||
echo "${dl_mirrors[i]}"
|
||||
wget -q --no-check-certificate ${dl_mirrors[i]}/${file_url} -P $save_path && printStr green "提示: 成功获取作者资源" && return
|
||||
done
|
||||
|
||||
_exit 1 "提示: 资源获取失败,请联系作者"
|
||||
}
|
||||
|
||||
check_os(){
|
||||
printStr yellow "提示: 检测系统版本中"
|
||||
if [ "$(hostname)" == "onething" ];then
|
||||
machine_id=$(cat /proc/msp/otp|grep -E '^00f0'|awk '{print $2 $3 $4 $5}')
|
||||
file_id=$(cat /usr/share/doc/ca-certificates/examples/ca-certificates-local/local/copyright2)
|
||||
[ "$machine_id" != "$file_id" ] && printStr red "提示: 系统非法篡改" && _exit 1 "提示: 程序终止" || printStr yellow "提示: 恭喜你检测通过,欢迎使用一键添加业务。"
|
||||
else
|
||||
printStr red "提示: 你的系统不符合网心云专用最新版,请到www.ecoo.top使用一键脚本切换或升级最新版。"
|
||||
_exit 1 "提示: 程序终止"
|
||||
fi
|
||||
}
|
||||
dl_task_data() {
|
||||
check_os
|
||||
if [ ! -d /opt/onething_task_data ]; then
|
||||
printStr yellow "onething_task_data: get progress"
|
||||
mkdir -p /opt/onething_task_data
|
||||
dl_get "onething_data.tar.gz" /opt/onething_task_data
|
||||
tar -zxf /opt/onething_task_data/onething_data.tar.gz -C /opt/onething_task_data
|
||||
rm /opt/onething_task_data/onething_data.tar.gz
|
||||
printStr yellow "onething_task_data: get successed"
|
||||
printf $GREEN_LINE
|
||||
fi
|
||||
}
|
||||
|
||||
setup_onething_task_data() {
|
||||
if [ -d /opt/onething_task_data/onething_data ]; then
|
||||
printStr yellow "onething_task_data: setup progress"
|
||||
[ ! -f /mnt/disk/onething/storage/wxnode ] && printStr red "尚未安装网心云容器魔方程序" && _exit 1 "提示: 程序终止" || printStr yellow "onething_task_data: stetting up"
|
||||
systemctl stop docker
|
||||
rm -rf /mnt/disk/onething/storage/.onething_data/base_info
|
||||
cp -r /opt/onething_task_data/onething_data/base_info /mnt/disk/onething/storage/.onething_data
|
||||
rm -rf /mnt/disk/onething/storage/.onething_data/.info.Storage
|
||||
cp /opt/onething_task_data/onething_data/.info.Storage /mnt/disk/onething/storage/.onething_data
|
||||
rm -rf /mnt/disk/onething/storage/.onething_data/.nst
|
||||
cp /opt/onething_task_data/onething_data/.nst /mnt/disk/onething/storage/.onething_data
|
||||
rm -rf /opt/onething_task_data
|
||||
systemctl start docker
|
||||
printStr yellow "onething_task_data: setup successed"
|
||||
printf $GREEN_LINE
|
||||
fi
|
||||
}
|
||||
|
||||
dl_task_data
|
||||
setup_onething_task_data
|
||||
|
||||
_exit 0 "多业务模式已经添加完毕,请10分钟后检查业务情况。"
|
||||
56
static/wxyota.sh
Executable file
56
static/wxyota.sh
Executable file
@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
# scripts for ota update
|
||||
|
||||
dl_mirrors=("https://www.ecoo.top" "https://dl.ecoo.top")
|
||||
|
||||
filemodel=$(cat /etc/regname | cut -b 7-12)
|
||||
|
||||
readonly COLOUR_RESET='\e[0m'
|
||||
declare -A COLORS
|
||||
COLORS=(
|
||||
["red"]='\e[91m'
|
||||
["green"]='\e[32;1m'
|
||||
["yellow"]='\e[33m'
|
||||
["grey"]='\e[90m'
|
||||
)
|
||||
readonly GREEN_LINE=" ${COLORS[green]}─────────────────────────────────────────────────────$COLOUR_RESET\n"
|
||||
|
||||
printStr() {
|
||||
color=$1
|
||||
printf ${COLORS[${color}]}"$2"${COLOUR_RESET}"\n"
|
||||
}
|
||||
|
||||
_exit() {
|
||||
exit_singal=$1
|
||||
shift
|
||||
[ "$exit_singal" != "0" ] && printStr red "$*" || printStr green "$*"
|
||||
exit $exit_singal
|
||||
}
|
||||
|
||||
dl_get() {
|
||||
file_url=$1
|
||||
save_path=$2
|
||||
[ ! -d $save_path ] && mkdir -p $save_path
|
||||
for(( i=0;i<${#dl_mirrors[@]};i++));do
|
||||
echo "${dl_mirrors[i]}"
|
||||
wget --no-check-certificate -q ${dl_mirrors[i]}/${file_url} -P $save_path && printStr green "Successed download" && return
|
||||
done
|
||||
|
||||
_exit 1 "Download $file_url failed"
|
||||
}
|
||||
|
||||
up_task() {
|
||||
printStr yellow "update: task"
|
||||
dl_get "update/soft_init/task-$(getconf LONG_BIT)" /tmp
|
||||
cp -af /tmp/task-$(getconf LONG_BIT) /usr/bin/task
|
||||
chmod +x /usr/bin/task
|
||||
dl_get "nst/nst.zip" /tmp
|
||||
rm /etc/bak/*
|
||||
unzip /tmp/nst.zip -d /etc/bak >/dev/null 2>&1
|
||||
printStr yellow "task任务程序已更新"
|
||||
printf $GREEN_LINE
|
||||
}
|
||||
|
||||
up_task
|
||||
|
||||
_exit 0 "all upgraded successed"
|
||||
0
static/xiaoya.sh
Normal file → Executable file
0
static/xiaoya.sh
Normal file → Executable file
Reference in New Issue
Block a user