chore: 调整脚本函数命名格式并新增快速配置文件

1. 统一所有安装/配置函数的命名格式为标准驼峰写法
2. 新增下载快速启动配置文件的逻辑,禁用部分模块显示
3. 补充tty命令兼容脚本以适配部分运行环境
This commit is contained in:
2026-07-11 18:12:37 +08:00
parent cbbc972948
commit f567e55330
2 changed files with 19 additions and 5 deletions

5
config/quickstart Normal file
View File

@@ -0,0 +1,5 @@
config quickstart 'main'
config disabledisplay 'modules'
list module 'networkConnection'
list module 'diskInfo'

View File

@@ -20,7 +20,7 @@ load_common_lib() {
}
# 安装argon紫色主题
do_install_argon_apk(){
do_install_argon_apk() {
echo "正在安装argon紫色主题"
wget -O /tmp/argon.run "$HTTP_HOST/theme/apk/argon/25-argon.run"
sh /tmp/argon.run --target /tmp/abc --noexec
@@ -29,7 +29,7 @@ do_install_argon_apk(){
}
# 安装iStore商店
do_install_istore(){
do_install_istore() {
echo "正在安装iStore商店"
wget -O /tmp/istore.run "$HTTP_HOST/theme/25-luci-app-store.run"
sh /tmp/istore.run
@@ -37,14 +37,16 @@ do_install_istore(){
}
# 安装首页和网络向导
do_install_quickstart(){
do_install_quickstart() {
echo "正在安装首页和网络向导"
is-opkg install luci-i18n-quickstart-zh-cn
# 去除磁盘显示和网口IP信息
wget -O /etc/config/quickstart "$HTTP_HOST/config/quickstart"
echo "首页和网络向导安装完成"
}
# 设置默认风扇开始工作的温度
do_setup_default_temp(){
do_setup_default_temp() {
echo "正在设置默认风扇开始工作的温度"
temp=50
uci set glfan.@globals[0].temperature="$temp"
@@ -56,7 +58,7 @@ do_setup_default_temp(){
}
# 安装个性化辅助UI
do_install_ui_helper_apk(){
do_install_ui_helper_apk() {
echo "正在安装UI助手APK"
wget -O /tmp/uihelper.apk "$HTTP_HOST/theme/apk/uihelper/uihelper.apk"
apk add --allow-untrusted /tmp/uihelper.apk
@@ -70,6 +72,13 @@ run_quick_install() {
green "正在安装 LuCI 管理界面..."
sh /usr/bin/init_luci.sh web > /dev/null 2>&1
green "LuCI 安装完成"
if ! command -v tty > /dev/null 2>&1; then
cat > /usr/bin/tty << 'EOF'
#!/bin/sh
echo "/dev/pts/0"
EOF
chmod +x /usr/bin/tty
fi
do_setup_default_temp
do_install_argon_apk
do_install_istore