Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 37c5382621 | |||
| f290ea7bb7 | |||
| 6530c30468 | |||
| 7e43ac49bd | |||
| 5bca6bdf6b | |||
| 5470ec1715 | |||
| b807868d3b | |||
| 4affca9f50 | |||
| ed261255a6 | |||
| 733b516ae1 | |||
| f6e0505b36 | |||
| 78883586c7 | |||
| dd17f79f32 | |||
| 3365f2dc4e | |||
| f083d69aa5 | |||
| 94ae1f16f6 | |||
| 6d00369eca | |||
| 6ea5759ce2 | |||
| 74ebba86e2 | |||
| 81510c2bc6 | |||
| e9996d501c | |||
| 0dc33672f3 | |||
| 3e1edb0a9b | |||
| d4465b37ca | |||
| 166bc41659 | |||
| 967a620da9 | |||
| 2590e262da | |||
| 7e92dbfc93 | |||
| 0940f0b06c | |||
| 18b99aa4b3 | |||
| 0a17979bad | |||
| 0633a7eea4 | |||
| 9357f5b17d | |||
| 0392d614b1 | |||
| c96a6f66f9 | |||
| 9c614d890a | |||
| f1824ea8a0 | |||
| e3441aafae | |||
| 3cf93ede5f | |||
| 8548078982 | |||
| 5364e18b14 | |||
| fa098833b1 | |||
| bc05c4db58 | |||
| d3abaf7810 | |||
| e18e39db35 | |||
| 7a6328f97f | |||
| 6cd09c0f10 | |||
| 86025e0d17 | |||
| 8f7fc19477 | |||
| 7fdd2f65b7 | |||
| 200a08e448 |
@ -51,7 +51,7 @@ Fork development, and PR development to development :)
|
||||
- If you don't get an error you should be getting replies back endlessly, press `CTRL-C` to stop it.
|
||||
- Simply Copy/Paste this into your Command Prompt/Shell
|
||||
```bash
|
||||
adb shell "cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh" && cd /
|
||||
adb shell "cd /tmp && curl -o RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/beta-curl/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh" && cd /
|
||||
```
|
||||
|
||||
**Or, if you want to stay in the modems shell when you are done**
|
||||
@ -61,7 +61,7 @@ adb shell
|
||||
```
|
||||
Then run
|
||||
```
|
||||
cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd /
|
||||
cd /tmp && curl -o RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/beta-curl/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd /
|
||||
```
|
||||
**You should see:**
|
||||

|
||||
|
||||
@ -49,7 +49,7 @@ Fork开发分支,并将PR提交到开发分支 :)
|
||||
- 如果没有错误,您应该会看到持续的回复,按`CTRL-C`停止
|
||||
- 只需将以下命令复制/粘贴到命令提示符/Shell中
|
||||
```bash
|
||||
adb shell "cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh" && cd /
|
||||
adb shell "cd /tmp && curl -o RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/beta-curl/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh" && cd /
|
||||
```
|
||||
|
||||
**或者,如果您想在完成后保持在调制解调器的shell中**
|
||||
@ -59,9 +59,10 @@ adb shell
|
||||
```
|
||||
然后运行
|
||||
```
|
||||
cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd /
|
||||
cd /tmp && curl -o RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/beta-curl/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd /
|
||||
```
|
||||
**您应该看到:**
|
||||
|
||||

|
||||
|
||||
## Tailscale安装和配置
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -80,9 +80,9 @@ done
|
||||
|
||||
echo -e '\033[32mInfo: Opkg package manager deployment...\033[0m'
|
||||
URL=http://bin.entware.net/${ARCH}/installer
|
||||
wget $URL/opkg -O /opt/bin/opkg
|
||||
curl -o /opt/bin/opkg "$URL/opkg"
|
||||
chmod 755 /opt/bin/opkg
|
||||
wget $URL/opkg.conf -O /opt/etc/opkg.conf
|
||||
curl -o /opt/etc/opkg.conf "$URL/opkg.conf"
|
||||
|
||||
echo -e '\033[32mInfo: Basic packages installation...\033[0m'
|
||||
/opt/bin/opkg update
|
||||
|
||||
@ -34,8 +34,8 @@ toolkit_menu() {
|
||||
read -p "Select an option (1-3): " option
|
||||
|
||||
case "$option" in
|
||||
1) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
||||
2) cd /tmp && wget -O RMxxx_rgmii_toolkit.sh https://code.060070.xyz/sky/simple-admin/raw/branch/main/RMxxx_rgmii_toolkit.sh && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
||||
1) cd /tmp && curl -o RMxxx_rgmii_toolkit.sh "https://code.060070.xyz/sky/simple-admin/raw/branch/beta-curl/RMxxx_rgmii_toolkit.sh" && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
||||
2) cd /tmp && curl -o RMxxx_rgmii_toolkit.sh "https://code.060070.xyz/sky/simple-admin/raw/branch/beta-curl/RMxxx_rgmii_toolkit.sh" && chmod +x RMxxx_rgmii_toolkit.sh && ./RMxxx_rgmii_toolkit.sh && cd / ;;
|
||||
3) break ;;
|
||||
*) echo "Invalid option. Please try again." ;;
|
||||
esac
|
||||
|
||||
@ -11,89 +11,35 @@ else
|
||||
firmware_revision="UNKNOWN"
|
||||
fi
|
||||
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
echo "=============================================================="
|
||||
# Start your Actual echo output here, 17 lines omitted for mobile compatibility. ttyd font needs to be size 25.
|
||||
# Echo "Logo"
|
||||
echo " .%+: "
|
||||
echo " .*@@@-. "
|
||||
echo " :@@@@- "
|
||||
echo " @@@@#. "
|
||||
echo " -@@@@#. "
|
||||
echo " :. %@@@@: -# "
|
||||
echo " .+- #@@@@%.+@- "
|
||||
echo " .#- . +@@@@# #@- "
|
||||
echo " -@*@*@% @@@@@::@@= "
|
||||
echo ".+%@@@@@@@@@%=. =@@@@# #@@- .. "
|
||||
echo " .@@@@@: :@@@@@ =@@@..%= "
|
||||
echo " -::@-.+. @@@@@.=@@@- =@- "
|
||||
echo " .@- .@@@@@:.@@@* @@. "
|
||||
echo " .%- -@@@@@:=@@@@ @@# "
|
||||
echo " .#- .%@@@@@@#. +@@@@@.#@@@@ @@@."
|
||||
echo " .*- .@@@@@@@@@@=. @@@@@@ @@@@@ @@@:"
|
||||
echo " :. .%@@@@@@@@@@@%. .@@@@@+:@@@@@ @@@-"
|
||||
echo " -@@@@@@@@@@@@@@@..@@@@@@.-@@@@@ .@@@-"
|
||||
echo " -@@@@@@@@@@%. .@@@@@@. @@@@@+ =@@@="
|
||||
echo " =@@@@@@@@* .@@@@@@. @@@@@@..@@@@-"
|
||||
echo " #@@@@@@@@-*@@@@@%..@@@@@@+ #@@@@-"
|
||||
echo " @@@@@@:.-@@@@@@. @@@@@@= %@@@@@."
|
||||
echo " .@@@@. *@@@@@@- .+@@@@@@-.@@@@@@+ "
|
||||
echo " %@@. =@@@@@*. +@@@@@@%.-@@@@@@% "
|
||||
echo " .@@ .@@@@@= :@@@@@@@@..@@@@@@@= "
|
||||
echo " =@.+@@@@@. -@@@@@@@*.:@@@@@@@*. "
|
||||
echo " %.*@@@@= .@@@@@@@-.:@@@@@@@+. "
|
||||
echo " ..@@@@= .@@@@@@: #@@@@@@@: "
|
||||
echo " .@@@@ +@@@@..%@@@@@+. "
|
||||
echo " .@@@. @@@@.:@@@@+. "
|
||||
echo " @@@. @@@. @@@* .@. "
|
||||
echo " :@@@ %@@..@@#. *@ "
|
||||
echo " -*: .@@* :@@. @@. -..@@ "
|
||||
echo " =@@@@@@.*@- :@% @* =@:=@# "
|
||||
echo " .@@@-+@@@@:%@..%- ...@%:@@: "
|
||||
echo " .@@. @@-%@: .%@@*@@%. "
|
||||
echo " :@@ :+ *@ *@@#*@@@. "
|
||||
echo " =@@@.@@@@ "
|
||||
echo " .*@@@:=@@@@: "
|
||||
echo " .@@@@:.@@@@@: "
|
||||
echo " .@@@@#.-@@@@@. "
|
||||
echo " #@@@@: =@@@@@- "
|
||||
echo " .@@@@@..@@@@@@* "
|
||||
echo " -@@@@@. @@@@@@#. "
|
||||
echo " -@@@@@ @@@@@@% "
|
||||
echo " @@@@@. #@@@@@@. "
|
||||
echo " :@@@@# =@@@@@@% "
|
||||
echo " @@@@@: @@@@@@@: "
|
||||
echo " *@@@@ @@@@@@@. "
|
||||
echo " .@@@@ @@@@@@@ "
|
||||
echo " #@@@. @@@@@@* "
|
||||
echo " @@@# @@@@@@@ "
|
||||
echo " .@@+=@@@@@@. "
|
||||
echo " *@@@@@@ "
|
||||
echo " :@@@@@= "
|
||||
echo " .@@@@@@. "
|
||||
echo " :@@@@@*. "
|
||||
echo " .=@@@@@- "
|
||||
echo " :+##+. "
|
||||
echo "=============================================================="
|
||||
echo "//////////////////////////////////////////////////////////////////";
|
||||
echo "// //";
|
||||
echo "// //";
|
||||
echo "// :'######::'####:'##::::'##:'########::'##:::::::'########: //";
|
||||
echo "// '##... ##:. ##:: ###::'###: ##.... ##: ##::::::: ##.....:: //";
|
||||
echo "// ##:::..::: ##:: ####'####: ##:::: ##: ##::::::: ##::::::: //";
|
||||
echo "// . ######::: ##:: ## ### ##: ########:: ##::::::: ######::: //";
|
||||
echo "// :..... ##:: ##:: ##. #: ##: ##.....::: ##::::::: ##...:::: //";
|
||||
echo "// '##::: ##:: ##:: ##:.:: ##: ##:::::::: ##::::::: ##::::::: //";
|
||||
echo "// . ######::'####: ##:::: ##: ##:::::::: ########: ########: //";
|
||||
echo "// :......:::....::..:::::..::..:::::::::........::........:: //";
|
||||
echo "// :::'###::::'########::'##::::'##:'####:'##::: ##: //";
|
||||
echo "// ::'## ##::: ##.... ##: ###::'###:. ##:: ###:: ##: //";
|
||||
echo "// :'##:. ##:: ##:::: ##: ####'####:: ##:: ####: ##: //";
|
||||
echo "// '##:::. ##: ##:::: ##: ## ### ##:: ##:: ## ## ##: //";
|
||||
echo "// #########: ##:::: ##: ##. #: ##:: ##:: ##. ####: //";
|
||||
echo "// ##.... ##: ##:::: ##: ##:.:: ##:: ##:: ##:. ###: //";
|
||||
echo "// ##:::: ##: ########:: ##:::: ##:'####: ##::. ##: //";
|
||||
echo "// ..:::::..::........:::..:::::..::....::..::::..:: //";
|
||||
echo "// //";
|
||||
echo "// By iamromulan //";
|
||||
echo "//////////////////////////////////////////////////////////////////";
|
||||
echo "==================================================================="
|
||||
echo "TTYd session file by iamromulan v1.1"
|
||||
echo "Firmware Revision: $firmware_revision"
|
||||
echo "Serial Number: $serial_number"
|
||||
echo "=============================================================="
|
||||
echo "==================================================================="
|
||||
|
||||
# Start a login session
|
||||
exec /bin/login
|
||||
|
||||
41
simpleadmin/www/cgi-bin/get_system_stats
Normal file
41
simpleadmin/www/cgi-bin/get_system_stats
Normal file
@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Send HTTP header for plain text content
|
||||
echo "Content-Type: text/plain"
|
||||
echo ""
|
||||
|
||||
# Read first CPU statistics
|
||||
read cpu user nice system idle iowait irq softirq steal guest guest_nice < /proc/stat
|
||||
|
||||
# Record first total usage time and idle time
|
||||
prev_total=$((user+nice+system+idle+iowait+irq+softirq+steal))
|
||||
prev_idle=$idle
|
||||
|
||||
# Wait for a short time to capture CPU usage
|
||||
sleep 0.5
|
||||
|
||||
# Read second CPU statistics
|
||||
read cpu user nice system idle iowait irq softirq steal guest guest_nice < /proc/stat
|
||||
|
||||
# Calculate second total usage time
|
||||
total=$((user+nice+system+idle+iowait+irq+softirq+steal))
|
||||
idle=$idle
|
||||
|
||||
# Calculate time differences
|
||||
total_diff=$((total-prev_total))
|
||||
idle_diff=$((idle-prev_idle))
|
||||
|
||||
# Calculate CPU usage percentage
|
||||
cpu_usage=$(awk -v total_diff="$total_diff" -v idle_diff="$idle_diff" 'BEGIN{printf "%.1f", (total_diff-idle_diff)*100/total_diff}')
|
||||
|
||||
# Get memory information
|
||||
mem_info=$(free -m | grep "Mem:")
|
||||
mem_total=$(echo "$mem_info" | awk '{print $2}')
|
||||
mem_used=$(echo "$mem_info" | awk '{print $3}')
|
||||
mem_usage=$(awk "BEGIN {printf \"%.1f\", ($mem_used * 100) / $mem_total}")
|
||||
|
||||
# Output results
|
||||
echo "CPU Usage: $cpu_usage"
|
||||
echo "Memory Usage: $mem_usage"
|
||||
echo "Memory Total: $((mem_total * 1024 * 1024))"
|
||||
echo "Memory Used: $((mem_used * 1024 * 1024))"
|
||||
@ -213,11 +213,11 @@
|
||||
<td x-text="networkMode"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Bands</th>
|
||||
<th scope="row">频段</th>
|
||||
<td x-text="bands"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">带宽</th>
|
||||
<th scope="row">频宽</th>
|
||||
<td x-text="bandwidth"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -278,6 +278,76 @@
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">系统状态</div>
|
||||
<div class="card-body">
|
||||
<div class="card-text table-responsive-sm">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">CPU使用率</th>
|
||||
<td class="gap-4 align-items-center"
|
||||
x-data="{ getProgressBarClass: function() {
|
||||
var percentage = parseInt(this.cpuUsage);
|
||||
if (percentage >= 80) {
|
||||
return 'progress-bar bg-danger is-medium';
|
||||
} else if (percentage >= 60) {
|
||||
return 'progress-bar bg-warning is-warning is-medium';
|
||||
} else {
|
||||
return 'progress-bar bg-success is-medium';
|
||||
}
|
||||
}}"
|
||||
>
|
||||
<div class="progress w-100" role="progressbar"
|
||||
aria-label="CPU Usage"
|
||||
:aria-valuenow="cpuUsage"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100"
|
||||
style="height: 18px"
|
||||
>
|
||||
<div :class="getProgressBarClass()"
|
||||
:style="'width: ' + cpuUsage + '%'"
|
||||
>
|
||||
<span x-text="cpuUsage + '%'"></span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">内存使用率</th>
|
||||
<td class="gap-4 align-items-center"
|
||||
x-data="{ getProgressBarClass: function() {
|
||||
var percentage = parseInt(this.memoryUsage);
|
||||
if (percentage >= 80) {
|
||||
return 'progress-bar bg-danger is-medium';
|
||||
} else if (percentage >= 60) {
|
||||
return 'progress-bar bg-warning is-warning is-medium';
|
||||
} else {
|
||||
return 'progress-bar bg-success is-medium';
|
||||
}
|
||||
}}"
|
||||
>
|
||||
<div class="progress w-100" role="progressbar"
|
||||
aria-label="Memory Usage"
|
||||
:aria-valuenow="memoryUsage"
|
||||
aria-valuemin="0"
|
||||
aria-valuemax="100"
|
||||
style="height: 18px"
|
||||
>
|
||||
<div :class="getProgressBarClass()"
|
||||
:style="'width: ' + memoryUsage + '%'"
|
||||
>
|
||||
<span x-text="memoryUsage + '% (' + formatBytes(memoryUsed) + ' / ' + formatBytes(memoryTotal) + ')'"></span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">信号</div>
|
||||
<div class="card-body">
|
||||
@ -649,11 +719,133 @@
|
||||
nonNrUpload: "0",
|
||||
downloadStat: "0",
|
||||
uploadStat: "0",
|
||||
cpuUsage: "0",
|
||||
memoryUsage: "0",
|
||||
cacheUsage: "0",
|
||||
memoryTotal: "0",
|
||||
memoryUsed: "0",
|
||||
cacheUsed: "0",
|
||||
|
||||
fetchAllInfo() {
|
||||
this.atcmd =
|
||||
'AT+QTEMP;+QUIMSLOT?;+QSPN;+CGCONTRDP=1;+QMAP="WWANIP";+QENG="servingcell";+QCAINFO;+QSIMSTAT?;+CSQ;+QGDNRCNT?;+QGDCNT?';
|
||||
|
||||
// ---------- 运营商名称处理 | Operator Information Processing ----------
|
||||
const operatorMap = {
|
||||
// 中国大陆 (460) | Mainland China (460)
|
||||
"46000": "中国移动 (CMCC)",
|
||||
"46001": "中国联通 (CU)",
|
||||
"46002": "中国移动 (CMCC)",
|
||||
"46003": "中国电信 (CT)",
|
||||
"46004": "中国移动 (CMCC)",
|
||||
"46005": "中国电信 (CT)",
|
||||
"46006": "中国联通 (CU)",
|
||||
"46007": "中国移动 (CMCC)",
|
||||
"46008": "中国移动 (CMCC)",
|
||||
"46009": "中国联通 (CU)",
|
||||
"46011": "中国电信 (CT)",
|
||||
|
||||
// 中国香港 (454) | Hong Kong, China (454)
|
||||
"45400": "香港移动通讯 (CSL)",
|
||||
"45401": "香港移动通讯 (CSL)",
|
||||
"45402": "香港移动通讯 (CSL)",
|
||||
"45403": "和记电讯 (3 HK)",
|
||||
"45404": "和记电讯 (3 HK)",
|
||||
"45405": "和记电讯 (3 HK)",
|
||||
"45406": "数码通 (SmarTone)",
|
||||
"45412": "中国移动香港 (CMHK)",
|
||||
"45413": "中国移动香港 (CMHK)",
|
||||
"45415": "数码通 (SmarTone)",
|
||||
"45416": "香港电讯 (PCCW)",
|
||||
"45417": "数码通 (SmarTone)",
|
||||
"45419": "香港电讯 (PCCW)",
|
||||
"45420": "香港电讯 (PCCW)",
|
||||
|
||||
// 中国澳门 (455) | Macau, China (455)
|
||||
"45501": "澳门电讯 (CTM)",
|
||||
"45502": "中国电信澳门 (CT Macau)",
|
||||
"45503": "和记澳门 (3 Macau)",
|
||||
"45505": "和记澳门 (3 Macau)",
|
||||
"45506": "数码通澳门 (SmarTone Macau)",
|
||||
|
||||
// 美国 (310-316) | United States (310-316)
|
||||
"310030": "AT&T Mobility",
|
||||
"310070": "AT&T Mobility",
|
||||
"310150": "AT&T Mobility",
|
||||
"310170": "AT&T Mobility",
|
||||
"310280": "AT&T Mobility",
|
||||
"310410": "AT&T Mobility",
|
||||
"310980": "AT&T Mobility",
|
||||
"311180": "AT&T Mobility",
|
||||
"310120": "Sprint",
|
||||
"310260": "T-Mobile USA",
|
||||
"310160": "T-Mobile USA",
|
||||
"311480": "Verizon Wireless",
|
||||
"310004": "Verizon Wireless",
|
||||
"310012": "Verizon Wireless",
|
||||
|
||||
// 加拿大 (302) | Canada (302)
|
||||
"302220": "Telus Mobility",
|
||||
"302221": "Telus Mobility",
|
||||
"302222": "Telus Mobility",
|
||||
"302270": "EastLink",
|
||||
"302320": "Rogers Wireless",
|
||||
"302370": "Rogers Wireless",
|
||||
"302720": "Rogers Wireless",
|
||||
"302490": "Freedom Mobile",
|
||||
"302500": "Videotron",
|
||||
"302610": "Bell Mobility",
|
||||
"302640": "Bell Mobility",
|
||||
"302690": "Bell Mobility",
|
||||
|
||||
// 西班牙 (214) | Spain (214)
|
||||
"21401": "Vodafone España",
|
||||
"21403": "Orange España",
|
||||
"21404": "Yoigo",
|
||||
"21405": "Movistar España",
|
||||
"21406": "Vodafone España",
|
||||
"21407": "Movistar España",
|
||||
"21408": "Euskaltel",
|
||||
"21409": "Orange España",
|
||||
|
||||
// 日本 (440-441) | Japan (440-441)
|
||||
"44000": "Y!mobile",
|
||||
"44001": "NTT DOCOMO",
|
||||
"44002": "NTT DOCOMO",
|
||||
"44003": "NTT DOCOMO",
|
||||
"44004": "SoftBank",
|
||||
"44006": "SoftBank",
|
||||
"44007": "KDDI (au)",
|
||||
"44008": "KDDI (au)",
|
||||
"44009": "NTT DOCOMO",
|
||||
"44010": "NTT DOCOMO",
|
||||
"44020": "SoftBank",
|
||||
"44021": "NTT DOCOMO",
|
||||
"44051": "KDDI (au)",
|
||||
"44052": "KDDI (au)",
|
||||
"44053": "KDDI (au)",
|
||||
"44054": "KDDI (au)",
|
||||
"44070": "KDDI (au)",
|
||||
"44071": "KDDI (au)",
|
||||
"44072": "KDDI (au)",
|
||||
"44073": "KDDI (au)",
|
||||
"44074": "KDDI (au)",
|
||||
"44075": "KDDI (au)",
|
||||
"44076": "KDDI (au)",
|
||||
|
||||
// 澳大利亚 (505) | Australia (505)
|
||||
"50501": "Telstra",
|
||||
"50502": "Optus",
|
||||
"50503": "Vodafone Australia",
|
||||
"50506": "Three Australia",
|
||||
"50507": "Vodafone Australia",
|
||||
"50508": "One.Tel",
|
||||
"50512": "Three Australia",
|
||||
"50571": "Telstra",
|
||||
"50572": "Telstra",
|
||||
"50590": "Optus"
|
||||
};
|
||||
|
||||
fetch(
|
||||
"/cgi-bin/get_atcommand?" +
|
||||
new URLSearchParams({
|
||||
@ -716,23 +908,30 @@
|
||||
this.activeSim = "无SIM卡";
|
||||
}
|
||||
|
||||
// --- Network Provider ---
|
||||
// find this example value from lines "+QSPN: \"515 66\",\"515 66\",\"DITO\",0,\"51566\""
|
||||
// remove any spaces
|
||||
const network_provider = lines
|
||||
// ---------- 运营商信息处理 | Operator Information Processing ----------
|
||||
const parts = lines
|
||||
.find((line) => line.includes("+QSPN:"))
|
||||
.split(",")[0]
|
||||
.replace("+QSPN: ", "")
|
||||
.replace(/"/g, "")
|
||||
.replace(/ /g, "");
|
||||
.split(",");
|
||||
|
||||
// if network provider is composed of numbers and spaces, and no letters then use .split(",")[2]
|
||||
if (network_provider.match(/^[0-9]+$/) != null) {
|
||||
this.networkProvider = lines
|
||||
.find((line) => line.includes("+QSPN:"))
|
||||
.split(",")[2]
|
||||
.replace(/"/g, "");
|
||||
// 获取 PLMN 码和运营商名称 | Get PLMN code and operator name
|
||||
const plmn = parts[4]?.replace(/"/g, "").trim();
|
||||
const network_provider = parts[0]?.replace("+QSPN: ", "").replace(/"/g, "").trim();
|
||||
|
||||
// 按优先级处理运营商名称 | Process operator name by priority
|
||||
if (operatorMap[plmn]) {
|
||||
// 1. 优先使用预定义的运营商映射 | First priority: use predefined operator mapping
|
||||
this.networkProvider = operatorMap[plmn];
|
||||
} else if (network_provider.match(/^[0-9A-Fa-f]+$/) != null) {
|
||||
// 2. 处理16进制编码的运营商名称 | Second priority: decode hex-encoded operator name
|
||||
try {
|
||||
const hexString = network_provider.replace(/^0x/, '');
|
||||
const bytes = new Uint8Array(hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16)));
|
||||
this.networkProvider = new TextDecoder('utf-8').decode(bytes);
|
||||
} catch {
|
||||
this.networkProvider = network_provider;
|
||||
}
|
||||
} else {
|
||||
// 3. 使用运营商提供的原始名称 | Third priority: use original operator name
|
||||
this.networkProvider = network_provider;
|
||||
}
|
||||
|
||||
@ -1457,7 +1656,7 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
bytesToSize(bytes) {
|
||||
@ -1807,13 +2006,11 @@
|
||||
// Set the refresh rate for interval
|
||||
this.intervalId = setInterval(() => {
|
||||
this.fetchUpTime();
|
||||
|
||||
this.fetchAllInfo();
|
||||
|
||||
this.fetchSystemStats();
|
||||
this.requestPing()
|
||||
.then((data) => {
|
||||
const response = data.trim();
|
||||
// Trim any leading/trailing spaces
|
||||
if (response === "OK") {
|
||||
this.internetConnectionStatus = "已连接";
|
||||
} else {
|
||||
@ -1824,11 +2021,33 @@
|
||||
console.error("Error:", error);
|
||||
this.internetConnectionStatus = "已断开";
|
||||
});
|
||||
|
||||
this.lastUpdate = new Date().toLocaleString();
|
||||
console.log("Refreshed");
|
||||
}, this.refreshRate * 1000);
|
||||
},
|
||||
|
||||
fetchSystemStats() {
|
||||
fetch("/cgi-bin/get_system_stats")
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
const lines = data.split("\n");
|
||||
// Skip blank lines and Content-Type lines.
|
||||
const validLines = lines.filter(line => line.trim() !== '' && line.includes(": ")).map(line => line.trim());
|
||||
|
||||
this.cpuUsage = parseFloat(validLines[0].split(": ")[1]).toFixed(1);
|
||||
this.memoryUsage = parseFloat(validLines[1].split(": ")[1]).toFixed(1);
|
||||
this.memoryTotal = parseInt(validLines[2].split(": ")[1]);
|
||||
this.memoryUsed = parseInt(validLines[3].split(": ")[1]);
|
||||
});
|
||||
},
|
||||
|
||||
formatBytes(bytes) {
|
||||
if (bytes === 0) return '0 B';
|
||||
const k = 1024;
|
||||
const sizes = ['B', 'KB', 'MB', 'GB'];
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
GITEA_HOST="code.060070.xyz"
|
||||
GITUSER="sky"
|
||||
REPONAME="simple-admin"
|
||||
GITTREE="main"
|
||||
GITMAINTREE="main"
|
||||
GITTREE="beta-curl"
|
||||
GITMAINTREE="beta-curl"
|
||||
GITDEVTREE="dev"
|
||||
|
||||
# Construct Gitea URLs
|
||||
@ -62,8 +62,8 @@ cat <<EOF > "$TMP_SCRIPT"
|
||||
GITEA_HOST="code.060070.xyz"
|
||||
GITUSER="sky"
|
||||
REPONAME="simple-admin"
|
||||
GITTREE="main"
|
||||
GITMAINTREE="main"
|
||||
GITTREE="beta-curl"
|
||||
GITMAINTREE="beta-curl"
|
||||
GITDEVTREE="dev"
|
||||
|
||||
# Construct Gitea URLs
|
||||
@ -90,6 +90,28 @@ remount_rw
|
||||
uninstall_simpleadmin() {
|
||||
echo "Uninstalling Simpleadmin..."
|
||||
|
||||
# Clean up Tailscale if present
|
||||
if [ -d "/usrdata/tailscale" ]; then
|
||||
echo "Cleaning up Tailscale..."
|
||||
# Stop and logout from Tailscale
|
||||
if [ -f "/usrdata/tailscale/tailscale" ]; then
|
||||
/usrdata/tailscale/tailscale logout
|
||||
/usrdata/tailscale/tailscale down
|
||||
fi
|
||||
|
||||
systemctl stop tailscale 2>/dev/null
|
||||
systemctl stop tailscale-webui 2>/dev/null
|
||||
rm -f /lib/systemd/system/tailscale.service
|
||||
|
||||
# Remove Tailscale files and directories
|
||||
rm -rf /usrdata/tailscale
|
||||
rm -f /bin/tailscale
|
||||
rm -f /bin/tailscaled
|
||||
|
||||
# Reload systemd
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
|
||||
# Check if Lighttpd service is installed and remove it if present
|
||||
if [ -f "/lib/systemd/system/lighttpd.service" ]; then
|
||||
echo "Lighttpd detected, uninstalling Lighttpd webserver and its modules..."
|
||||
@ -136,8 +158,8 @@ install_lighttpd() {
|
||||
systemctl stop lighttpd
|
||||
echo -e "\033[0;32mInstalling/Updating Lighttpd...\033[0m"
|
||||
mkdir -p "$SIMPLE_ADMIN_DIR"
|
||||
wget -O "$SIMPLE_ADMIN_DIR/lighttpd.conf" $GITROOT/simpleadmin/lighttpd.conf
|
||||
wget -O "/lib/systemd/system/lighttpd.service" $GITROOT/simpleadmin/systemd/lighttpd.service
|
||||
curl -o "$SIMPLE_ADMIN_DIR/lighttpd.conf" "$GITROOT/simpleadmin/lighttpd.conf"
|
||||
curl -o "/lib/systemd/system/lighttpd.service" "$GITROOT/simpleadmin/systemd/lighttpd.service"
|
||||
ln -sf "/lib/systemd/system/lighttpd.service" "/lib/systemd/system/multi-user.target.wants/"
|
||||
echo "www-data ALL = (root) NOPASSWD: /usr/sbin/iptables, /usr/sbin/ip6tables, /usrdata/simplefirewall/ttl-override, /bin/echo, /bin/cat" > /opt/etc/sudoers.d/www-data
|
||||
|
||||
@ -165,57 +187,58 @@ echo -e "\e[1;31m2) Installing simpleadmin from the $GITTREE branch\e[0m"
|
||||
mkdir $SIMPLE_ADMIN_DIR/www/css
|
||||
mkdir $SIMPLE_ADMIN_DIR/www/js
|
||||
cd $SIMPLE_ADMIN_DIR/systemd
|
||||
wget $GITROOT/simpleadmin/systemd/lighttpd.service
|
||||
curl -o lighttpd.service "$GITROOT/simpleadmin/systemd/lighttpd.service"
|
||||
sleep 1
|
||||
cd $SIMPLE_ADMIN_DIR/script
|
||||
wget $GITROOT/simpleadmin/script/ttl_script.sh
|
||||
wget $GITROOT/simpleadmin/script/remove_watchcat.sh
|
||||
wget $GITROOT/simpleadmin/script/create_watchcat.sh
|
||||
curl -o ttl_script.sh "$GITROOT/simpleadmin/script/ttl_script.sh"
|
||||
curl -o remove_watchcat.sh "$GITROOT/simpleadmin/script/remove_watchcat.sh"
|
||||
curl -o create_watchcat.sh "$GITROOT/simpleadmin/script/create_watchcat.sh"
|
||||
sleep 1
|
||||
cd $SIMPLE_ADMIN_DIR/console
|
||||
wget $GITROOT/simpleadmin/console/.profile
|
||||
curl -o .profile "$GITROOT/simpleadmin/console/.profile"
|
||||
sleep 1
|
||||
cd $SIMPLE_ADMIN_DIR/console/menu
|
||||
wget $GITROOT/simpleadmin/console/menu/start_menu.sh
|
||||
curl -o start_menu.sh "$GITROOT/simpleadmin/console/menu/start_menu.sh"
|
||||
ln -f $SIMPLE_ADMIN_DIR/console/menu/start_menu.sh /usrdata/root/bin/menu
|
||||
wget $GITROOT/simpleadmin/console/menu/sfirewall_settings.sh
|
||||
wget $GITROOT/simpleadmin/console/menu/LAN_settings.sh
|
||||
wget $GITROOT/simpleadmin/console/menu/start_menu.sh
|
||||
curl -o sfirewall_settings.sh "$GITROOT/simpleadmin/console/menu/sfirewall_settings.sh"
|
||||
curl -o LAN_settings.sh "$GITROOT/simpleadmin/console/menu/LAN_settings.sh"
|
||||
curl -o start_menu.sh "$GITROOT/simpleadmin/console/menu/start_menu.sh"
|
||||
sleep 1
|
||||
cd $SIMPLE_ADMIN_DIR/www
|
||||
wget $GITROOT/simpleadmin/www/deviceinfo.html
|
||||
wget $GITROOT/simpleadmin/www/favicon.ico
|
||||
wget $GITROOT/simpleadmin/www/index.html
|
||||
wget $GITROOT/simpleadmin/www/network.html
|
||||
wget $GITROOT/simpleadmin/www/settings.html
|
||||
wget $GITROOT/simpleadmin/www/sms.html
|
||||
wget $GITROOT/simpleadmin/www/scanner.html
|
||||
wget $GITROOT/simpleadmin/www/watchcat.html
|
||||
curl -o deviceinfo.html "$GITROOT/simpleadmin/www/deviceinfo.html"
|
||||
curl -o favicon.ico "$GITROOT/simpleadmin/www/favicon.ico"
|
||||
curl -o index.html "$GITROOT/simpleadmin/www/index.html"
|
||||
curl -o network.html "$GITROOT/simpleadmin/www/network.html"
|
||||
curl -o settings.html "$GITROOT/simpleadmin/www/settings.html"
|
||||
curl -o sms.html "$GITROOT/simpleadmin/www/sms.html"
|
||||
curl -o scanner.html "$GITROOT/simpleadmin/www/scanner.html"
|
||||
curl -o watchcat.html "$GITROOT/simpleadmin/www/watchcat.html"
|
||||
sleep 1
|
||||
cd $SIMPLE_ADMIN_DIR/www/js
|
||||
wget $GITROOT/simpleadmin/www/js/alpinejs.min.js
|
||||
wget $GITROOT/simpleadmin/www/js/bootstrap.bundle.min.js
|
||||
wget $GITROOT/simpleadmin/www/js/dark-mode.js
|
||||
wget $GITROOT/simpleadmin/www/js/generate-freq-box.js
|
||||
wget $GITROOT/simpleadmin/www/js/parse-settings.js
|
||||
wget $GITROOT/simpleadmin/www/js/populate-checkbox.js
|
||||
curl -o alpinejs.min.js "$GITROOT/simpleadmin/www/js/alpinejs.min.js"
|
||||
curl -o bootstrap.bundle.min.js "$GITROOT/simpleadmin/www/js/bootstrap.bundle.min.js"
|
||||
curl -o dark-mode.js "$GITROOT/simpleadmin/www/js/dark-mode.js"
|
||||
curl -o generate-freq-box.js "$GITROOT/simpleadmin/www/js/generate-freq-box.js"
|
||||
curl -o parse-settings.js "$GITROOT/simpleadmin/www/js/parse-settings.js"
|
||||
curl -o populate-checkbox.js "$GITROOT/simpleadmin/www/js/populate-checkbox.js"
|
||||
sleep 1
|
||||
cd $SIMPLE_ADMIN_DIR/www/css
|
||||
wget $GITROOT/simpleadmin/www/css/bootstrap.min.css
|
||||
wget $GITROOT/simpleadmin/www/css/styles.css
|
||||
curl -o bootstrap.min.css "$GITROOT/simpleadmin/www/css/bootstrap.min.css"
|
||||
curl -o styles.css "$GITROOT/simpleadmin/www/css/styles.css"
|
||||
sleep 1
|
||||
cd $SIMPLE_ADMIN_DIR/www/cgi-bin
|
||||
wget $GITROOT/simpleadmin/www/cgi-bin/get_atcommand
|
||||
wget $GITROOT/simpleadmin/www/cgi-bin/user_atcommand
|
||||
wget $GITROOT/simpleadmin/www/cgi-bin/get_ping
|
||||
wget $GITROOT/simpleadmin/www/cgi-bin/get_sms
|
||||
wget $GITROOT/simpleadmin/www/cgi-bin/get_ttl_status
|
||||
wget $GITROOT/simpleadmin/www/cgi-bin/set_ttl
|
||||
wget $GITROOT/simpleadmin/www/cgi-bin/send_sms
|
||||
wget $GITROOT/simpleadmin/www/cgi-bin/get_uptime
|
||||
wget $GITROOT/simpleadmin/www/cgi-bin/get_watchcat_status
|
||||
wget $GITROOT/simpleadmin/www/cgi-bin/set_watchcat
|
||||
wget $GITROOT/simpleadmin/www/cgi-bin/watchcat_maker
|
||||
curl -o get_atcommand "$GITROOT/simpleadmin/www/cgi-bin/get_atcommand"
|
||||
curl -o user_atcommand "$GITROOT/simpleadmin/www/cgi-bin/user_atcommand"
|
||||
curl -o get_ping "$GITROOT/simpleadmin/www/cgi-bin/get_ping"
|
||||
curl -o get_sms "$GITROOT/simpleadmin/www/cgi-bin/get_sms"
|
||||
curl -o get_system_stats "$GITROOT/simpleadmin/www/cgi-bin/get_system_stats"
|
||||
curl -o get_ttl_status "$GITROOT/simpleadmin/www/cgi-bin/get_ttl_status"
|
||||
curl -o set_ttl "$GITROOT/simpleadmin/www/cgi-bin/set_ttl"
|
||||
curl -o send_sms "$GITROOT/simpleadmin/www/cgi-bin/send_sms"
|
||||
curl -o get_uptime "$GITROOT/simpleadmin/www/cgi-bin/get_uptime"
|
||||
curl -o get_watchcat_status "$GITROOT/simpleadmin/www/cgi-bin/get_watchcat_status"
|
||||
curl -o set_watchcat "$GITROOT/simpleadmin/www/cgi-bin/set_watchcat"
|
||||
curl -o watchcat_maker "$GITROOT/simpleadmin/www/cgi-bin/watchcat_maker"
|
||||
sleep 1
|
||||
cd /
|
||||
chmod +x $SIMPLE_ADMIN_DIR/www/cgi-bin/*
|
||||
@ -232,10 +255,10 @@ echo -e "\e[1;31m2) Installing simpleadmin from the $GITTREE branch\e[0m"
|
||||
install_ttyd() {
|
||||
echo -e "\e[1;34mStarting ttyd installation process...\e[0m"
|
||||
cd $SIMPLE_ADMIN_DIR/console
|
||||
curl -L -o ttyd https://code.060070.xyz/sky/simple-admin/raw/branch/main/tools/ttyd.armhf && chmod +x ttyd
|
||||
wget "$GITROOT/simpleadmin/console/ttyd.bash" && chmod +x ttyd.bash
|
||||
curl -L -o ttyd https://code.060070.xyz/sky/simple-admin/raw/branch/beta-curl/tools/ttyd.armhf && chmod +x ttyd
|
||||
curl -o ttyd.bash "$GITROOT/simpleadmin/console/ttyd.bash" && chmod +x ttyd.bash
|
||||
cd $SIMPLE_ADMIN_DIR/systemd/
|
||||
wget "$GITROOT/simpleadmin/systemd/ttyd.service"
|
||||
curl -o ttyd.service "$GITROOT/simpleadmin/systemd/ttyd.service"
|
||||
cp -f $SIMPLE_ADMIN_DIR/systemd/ttyd.service /lib/systemd/system/
|
||||
ln -sf /usrdata/simpleadmin/ttyd /bin
|
||||
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
GITEA_HOST="code.060070.xyz"
|
||||
GITUSER="sky"
|
||||
REPONAME="simple-admin"
|
||||
GITTREE="main"
|
||||
GITMAINTREE="main"
|
||||
GITTREE="beta-curl"
|
||||
GITMAINTREE="beta-curl"
|
||||
GITDEVTREE="dev"
|
||||
|
||||
# Construct Gitea URLs
|
||||
@ -58,8 +58,8 @@ cat <<EOF > "$TMP_SCRIPT"
|
||||
GITEA_HOST="code.060070.xyz"
|
||||
GITUSER="sky"
|
||||
REPONAME="simple-admin"
|
||||
GITTREE="main"
|
||||
GITMAINTREE="main"
|
||||
GITTREE="beta-curl"
|
||||
GITMAINTREE="beta-curl"
|
||||
GITDEVTREE="dev"
|
||||
|
||||
# Construct Gitea URLs
|
||||
@ -102,14 +102,14 @@ install_simple_firewall() {
|
||||
mount -o remount,rw /
|
||||
mkdir -p "$SIMPLE_FIREWALL_DIR"
|
||||
mkdir -p "$SIMPLE_FIREWALL_SYSTEMD_DIR"
|
||||
wget -O "$SIMPLE_FIREWALL_DIR/simplefirewall.sh" $GITROOT/simplefirewall/simplefirewall.sh
|
||||
wget -O "$SIMPLE_FIREWALL_DIR/ttl-override" $GITROOT/simplefirewall/ttl-override
|
||||
wget -O "$SIMPLE_FIREWALL_DIR/ttlvalue" $GITROOT/simplefirewall/ttlvalue
|
||||
curl -o "$SIMPLE_FIREWALL_DIR/simplefirewall.sh" "$GITROOT/simplefirewall/simplefirewall.sh"
|
||||
curl -o "$SIMPLE_FIREWALL_DIR/ttl-override" "$GITROOT/simplefirewall/ttl-override"
|
||||
curl -o "$SIMPLE_FIREWALL_DIR/ttlvalue" "$GITROOT/simplefirewall/ttlvalue"
|
||||
chmod 666 $SIMPLE_FIREWALL_DIR/ttlvalue
|
||||
chmod +x "$SIMPLE_FIREWALL_DIR/simplefirewall.sh"
|
||||
chmod +x "$SIMPLE_FIREWALL_DIR/ttl-override"
|
||||
wget -O "$SIMPLE_FIREWALL_SYSTEMD_DIR/simplefirewall.service" $GITROOT/simplefirewall/systemd/simplefirewall.service
|
||||
wget -O "$SIMPLE_FIREWALL_SYSTEMD_DIR/ttl-override.service" $GITROOT/simplefirewall/systemd/ttl-override.service
|
||||
curl -o "$SIMPLE_FIREWALL_SYSTEMD_DIR/simplefirewall.service" "$GITROOT/simplefirewall/systemd/simplefirewall.service"
|
||||
curl -o "$SIMPLE_FIREWALL_SYSTEMD_DIR/ttl-override.service" "$GITROOT/simplefirewall/systemd/ttl-override.service"
|
||||
cp -rf $SIMPLE_FIREWALL_SYSTEMD_DIR/* /lib/systemd/system
|
||||
ln -sf "/lib/systemd/system/simplefirewall.service" "/lib/systemd/system/multi-user.target.wants/"
|
||||
ln -sf "/lib/systemd/system/ttl-override.service" "/lib/systemd/system/multi-user.target.wants/"
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
GITEA_HOST="code.060070.xyz"
|
||||
GITUSER="sky"
|
||||
REPONAME="simple-admin"
|
||||
GITTREE="main"
|
||||
GITMAINTREE="main"
|
||||
GITTREE="beta-curl"
|
||||
GITMAINTREE="beta-curl"
|
||||
GITDEVTREE="dev"
|
||||
|
||||
# Construct Gitea URLs
|
||||
@ -55,8 +55,8 @@ cat <<EOF > "$TMP_SCRIPT"
|
||||
GITEA_HOST="code.060070.xyz"
|
||||
GITUSER="sky"
|
||||
REPONAME="simple-admin"
|
||||
GITTREE="main"
|
||||
GITMAINTREE="main"
|
||||
GITTREE="beta-curl"
|
||||
GITMAINTREE="beta-curl"
|
||||
GITDEVTREE="dev"
|
||||
|
||||
# Construct Gitea URLs
|
||||
@ -110,18 +110,18 @@ install_at_socat() {
|
||||
mkdir $SOCAT_AT_DIR
|
||||
cd $SOCAT_AT_DIR
|
||||
mkdir $SOCAT_AT_SYSD_DIR
|
||||
wget $GITROOT/socat-at-bridge/socat-armel-static
|
||||
wget $GITROOT/socat-at-bridge/killsmd7bridge
|
||||
wget $GITROOT/socat-at-bridge/atcmd
|
||||
wget $GITROOT/socat-at-bridge/atcmd11
|
||||
curl -O "$GITROOT/socat-at-bridge/socat-armel-static"
|
||||
curl -O "$GITROOT/socat-at-bridge/killsmd7bridge"
|
||||
curl -O "$GITROOT/socat-at-bridge/atcmd"
|
||||
curl -O "$GITROOT/socat-at-bridge/atcmd11"
|
||||
cd $SOCAT_AT_SYSD_DIR
|
||||
wget $GITROOT/socat-at-bridge/systemd_units/socat-smd11.service
|
||||
wget $GITROOT/socat-at-bridge/systemd_units/socat-smd11-from-ttyIN.service
|
||||
wget $GITROOT/socat-at-bridge/systemd_units/socat-smd11-to-ttyIN.service
|
||||
wget $GITROOT/socat-at-bridge/systemd_units/socat-killsmd7bridge.service
|
||||
wget $GITROOT/socat-at-bridge/systemd_units/socat-smd7-from-ttyIN2.service
|
||||
wget $GITROOT/socat-at-bridge/systemd_units/socat-smd7-to-ttyIN2.service
|
||||
wget $GITROOT/socat-at-bridge/systemd_units/socat-smd7.service
|
||||
curl -O "$GITROOT/socat-at-bridge/systemd_units/socat-smd11.service"
|
||||
curl -O "$GITROOT/socat-at-bridge/systemd_units/socat-smd11-from-ttyIN.service"
|
||||
curl -O "$GITROOT/socat-at-bridge/systemd_units/socat-smd11-to-ttyIN.service"
|
||||
curl -O "$GITROOT/socat-at-bridge/systemd_units/socat-killsmd7bridge.service"
|
||||
curl -O "$GITROOT/socat-at-bridge/systemd_units/socat-smd7-from-ttyIN2.service"
|
||||
curl -O "$GITROOT/socat-at-bridge/systemd_units/socat-smd7-to-ttyIN2.service"
|
||||
curl -O "$GITROOT/socat-at-bridge/systemd_units/socat-smd7.service"
|
||||
|
||||
# Set execute permissions
|
||||
cd $SOCAT_AT_DIR
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
GITEA_HOST="code.060070.xyz"
|
||||
GITUSER="sky"
|
||||
REPONAME="simple-admin"
|
||||
GITTREE="main"
|
||||
GITMAINTREE="main"
|
||||
GITTREE="beta-curl"
|
||||
GITMAINTREE="beta-curl"
|
||||
GITDEVTREE="dev"
|
||||
|
||||
# Construct Gitea URLs
|
||||
@ -46,8 +46,8 @@ cat <<EOF > "$TMP_SCRIPT"
|
||||
GITEA_HOST="code.060070.xyz"
|
||||
GITUSER="sky"
|
||||
REPONAME="simple-admin"
|
||||
GITTREE="main"
|
||||
GITMAINTREE="main"
|
||||
GITTREE="beta-curl"
|
||||
GITMAINTREE="beta-curl"
|
||||
GITDEVTREE="dev"
|
||||
|
||||
# Construct Gitea URLs
|
||||
@ -62,7 +62,7 @@ echo -e "\e[1;32mOpenSSH Server\e[0m"
|
||||
remount_rw
|
||||
|
||||
mkdir /usrdata/sshd
|
||||
wget -O /lib/systemd/system/sshd.service "$GITROOT/sshd/sshd.service"
|
||||
curl -o /lib/systemd/system/sshd.service "$GITROOT/sshd/sshd.service"
|
||||
ln -sf "/lib/systemd/system/sshd.service" "/lib/systemd/system/multi-user.target.wants/"
|
||||
|
||||
opkg install openssh-server-pam
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
GITEA_HOST="code.060070.xyz"
|
||||
GITUSER="sky"
|
||||
REPONAME="simple-admin"
|
||||
GITTREE="main"
|
||||
GITMAINTREE="main"
|
||||
GITTREE="beta-curl"
|
||||
GITMAINTREE="beta-curl"
|
||||
GITDEVTREE="dev"
|
||||
|
||||
# Construct Gitea URLs
|
||||
@ -64,8 +64,8 @@ export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:/usrdata/root/bin
|
||||
GITEA_HOST="code.060070.xyz"
|
||||
GITUSER="sky"
|
||||
REPONAME="simple-admin"
|
||||
GITTREE="main"
|
||||
GITMAINTREE="main"
|
||||
GITTREE="beta-curl"
|
||||
GITMAINTREE="beta-curl"
|
||||
GITDEVTREE="dev"
|
||||
|
||||
# Construct Gitea URLs
|
||||
@ -101,16 +101,16 @@ install_update_tailscale() {
|
||||
mkdir -p "$TAILSCALE_DIR" "$TAILSCALE_SYSD_DIR"
|
||||
echo "Downloading binary files..."
|
||||
cd /usrdata
|
||||
curl -O https://pkgs.tailscale.com/stable/tailscale_1.76.1_arm.tgz
|
||||
tar -xzf tailscale_1.76.1_arm.tgz
|
||||
rm tailscale_1.76.1_arm.tgz
|
||||
cd /usrdata/tailscale_1.76.1_arm
|
||||
curl -O https://pkgs.tailscale.com/stable/tailscale_1.78.1_arm.tgz
|
||||
tar -xzf tailscale_1.78.1_arm.tgz
|
||||
rm tailscale_1.78.1_arm.tgz
|
||||
cd /usrdata/tailscale_1.78.1_arm
|
||||
mv tailscale tailscaled "$TAILSCALE_DIR/"
|
||||
rm -rf /usrdata/tailscale_1.76.1_arm
|
||||
rm -rf /usrdata/tailscale_1.78.1_arm
|
||||
echo "Downloading systemd files..."
|
||||
cd "$TAILSCALE_SYSD_DIR"
|
||||
wget $GITROOT/tailscale/systemd/tailscaled.service
|
||||
wget $GITROOT/tailscale/systemd/tailscaled.defaults
|
||||
curl -O "$GITROOT/tailscale/systemd/tailscaled.service"
|
||||
curl -O "$GITROOT/tailscale/systemd/tailscaled.defaults"
|
||||
sleep 2s
|
||||
echo "Setting Permissions..."
|
||||
chmod +x "$TAILSCALE_DIR/tailscaled" "$TAILSCALE_DIR/tailscale"
|
||||
|
||||
@ -7,7 +7,7 @@ CONFIG_FILE="/usrdata/simpleupdates/simpleupdate.conf"
|
||||
GITEA_HOST="code.060070.xyz"
|
||||
GITUSER="sky"
|
||||
REPONAME="simple-admin"
|
||||
GITTREE="main"
|
||||
GITTREE="beta-curl"
|
||||
|
||||
# Monitored directories
|
||||
DIRECTORIES=("simpleadmin" "socat-at-bridge" "simplefirewall" "tailscale" "ttyd")
|
||||
@ -36,7 +36,7 @@ trim_log_file() {
|
||||
check_for_updates() {
|
||||
echo "$(date): Checking for updates..."
|
||||
for dir in "${DIRECTORIES[@]}"; do
|
||||
local remote_rev=$(wget -qO- "$BASE_URL/$dir/.rev")
|
||||
local remote_rev=$(curl -s "$BASE_URL/$dir/.rev")
|
||||
local local_rev_file="/usrdata/$dir/.rev"
|
||||
|
||||
if [[ ! -f "$local_rev_file" ]]; then
|
||||
@ -48,7 +48,7 @@ check_for_updates() {
|
||||
|
||||
if [[ "$remote_rev" -gt "$local_rev" ]]; then
|
||||
echo "Update available for $dir, updating..."
|
||||
wget -qO "/tmp/update_${dir}.sh" "$BASE_URL/simpleupdates/scripts/update_${dir}.sh"
|
||||
curl -so "/tmp/update_${dir}.sh" "$BASE_URL/simpleupdates/scripts/update_${dir}.sh"
|
||||
chmod +x "/tmp/update_${dir}.sh"
|
||||
"/tmp/update_${dir}.sh"
|
||||
else
|
||||
@ -127,7 +127,7 @@ fi
|
||||
force_check_for_updates() {
|
||||
echo "$(date): Checking for updates..."
|
||||
for dir in "${DIRECTORIES[@]}"; do
|
||||
local remote_rev=$(wget -qO- "$BASE_URL/$dir/.rev")
|
||||
local remote_rev=$(curl -s "$BASE_URL/$dir/.rev")
|
||||
local local_rev_file="/usrdata/$dir/.rev"
|
||||
|
||||
if [[ ! -f "$local_rev_file" ]]; then
|
||||
@ -139,7 +139,7 @@ force_check_for_updates() {
|
||||
|
||||
if [[ "$remote_rev" -gt "$local_rev" ]]; then
|
||||
echo "Update available for $dir, updating..."
|
||||
wget -qO "/tmp/update_${dir}.sh" "$BASE_URL/simpleupdates/scripts/update_${dir}.sh"
|
||||
curl -so "/tmp/update_${dir}.sh" "$BASE_URL/simpleupdates/scripts/update_${dir}.sh"
|
||||
chmod +x "/tmp/update_${dir}.sh"
|
||||
"/tmp/update_${dir}.sh"
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user