~修改自动update内置ubuntu版本为最新release版本
~适配小米万兆路由,增加安装时目录选项
This commit is contained in:
juewuy
2023-04-02 19:39:53 +08:00
parent 6fdd506bcb
commit cac9d8534c
2 changed files with 20 additions and 22 deletions

View File

@@ -9,14 +9,14 @@ on:
# branches: # branches:
# - master # - master
schedule: schedule:
- cron: 0 9 * * 6 - cron: 0 18 * * 6
# watch: # watch:
# types: [started] # types: [started]
workflow_dispatch: workflow_dispatch:
jobs: jobs:
update: update:
runs-on: ubuntu-18.04 runs-on: ubuntu-latest
steps: steps:

View File

@@ -77,14 +77,25 @@ setdir(){
set_usb_dir set_usb_dir
fi fi
} }
set_cust_dir(){
echo -----------------------------------------------
echo '可用路径 剩余空间:'
df -h | awk '{print $6,$4}'| sed 1d
echo '路径是必须带 / 的格式,注意写入虚拟内存(/tmp,/opt,/sys...)的文件会在重启后消失!!!'
read -p "请输入自定义路径 > " dir
if [ "$(dir_avail $dir)" = 0 ] &&;then
$echo "\033[31m路径错误请重新设置\033[0m"
setdir
fi
}
echo ----------------------------------------------- echo -----------------------------------------------
if [ -n "$systype" ];then if [ -n "$systype" ];then
[ "$systype" = "Padavan" ] && dir=/etc/storage [ "$systype" = "Padavan" ] && dir=/etc/storage
[ "$systype" = "mi_snapshot" ] && { [ "$systype" = "mi_snapshot" ] && {
$echo "\033[33m检测到当前设备为小米官方系统请选择安装位置\033[0m" $echo "\033[33m检测到当前设备为小米官方系统请选择安装位置\033[0m"
$echo " 1 安装到/data目录(推荐,支持软固化功能)" [ "$(dir_avail /data)" != 0 ] && $echo " 1 安装到 /data 目录(推荐,支持软固化功能)"
$echo " 2 安装到USB设备(支持软固化功能)" [ "$(dir_avail /userdisk)" != 0 ] && $echo " 2 安装到 /userdisk 目录(推荐,支持软固化功能)"
[ "$(dir_avail /etc)" != 0 ] && $echo " 3 安装到/etc目录(不推荐)" $echo " 3 安装自定义目录(不推荐,不明勿用!)"
$echo " 0 退出安装" $echo " 0 退出安装"
echo ----------------------------------------------- echo -----------------------------------------------
read -p "请输入相应数字 > " num read -p "请输入相应数字 > " num
@@ -93,15 +104,10 @@ if [ -n "$systype" ];then
dir=/data dir=/data
;; ;;
2) 2)
set_usb_dir ;; dir=/userdisk
;;
3) 3)
if [ "$(dir_avail /etc)" != 0 ];then set_cust_dir
dir=/etc
systype=""
else
$echo "\033[31m你的设备不支持安装到/etc目录已改为安装到/data\033[0m"
dir=data
fi
;; ;;
*) *)
exit 1 ;; exit 1 ;;
@@ -152,15 +158,7 @@ else
elif [ "$num" = "4" ];then elif [ "$num" = "4" ];then
set_usb_dir set_usb_dir
elif [ "$num" = "5" ];then elif [ "$num" = "5" ];then
echo ----------------------------------------------- set_cust_dir
echo '可用路径 剩余空间:'
df -h | awk '{print $6,$4}'| sed 1d
echo '路径是必须带 / 的格式,注意写入虚拟内存(/tmp,/opt,/sys...)的文件会在重启后消失!!!'
read -p "请输入自定义路径 > " dir
if [ -z "$dir" ];then
$echo "\033[31m路径错误请重新设置\033[0m"
setdir
fi
else else
echo 安装已取消!!! echo 安装已取消!!!
exit 1; exit 1;