add Regular match file name for "Local upload"

This commit is contained in:
Ing 2023-12-03 16:51:00 +08:00
parent c2f218b9a1
commit 900c9da544
6 changed files with 48 additions and 42 deletions

View File

@ -1169,19 +1169,19 @@ msgid ""
msgstr "" msgstr ""
#: menu.sh:2069 #: menu.sh:2069
msgid "Upload update.zip will update RR.\\n" msgid "Upload update*.zip will update RR.\\n"
msgstr "" msgstr ""
#: menu.sh:2070 #: menu.sh:2070
msgid "Upload addons.zip will update Addons.\\n" msgid "Upload addons*.zip will update Addons.\\n"
msgstr "" msgstr ""
#: menu.sh:2071 #: menu.sh:2071
msgid "Upload modules.zip will update Modules.\\n" msgid "Upload modules*.zip will update Modules.\\n"
msgstr "" msgstr ""
#: menu.sh:2072 #: menu.sh:2072
msgid "Upload rp-lkms.zip will update LKMs.\\n" msgid "Upload rp-lkms*.zip will update LKMs.\\n"
msgstr "" msgstr ""
#: menu.sh:2121 #: menu.sh:2121

View File

@ -1185,20 +1185,20 @@ msgid ""
msgstr "请保持附件名称与 github 上附件名称一致.\\n" msgstr "请保持附件名称与 github 上附件名称一致.\\n"
#: menu.sh:2069 #: menu.sh:2069
msgid "Upload update.zip will update RR.\\n" msgid "Upload update*.zip will update RR.\\n"
msgstr "上传 update.zip 将更新 RR.\\n" msgstr "上传 update*.zip 将更新 RR.\\n"
#: menu.sh:2070 #: menu.sh:2070
msgid "Upload addons.zip will update Addons.\\n" msgid "Upload addons*.zip will update Addons.\\n"
msgstr "上传 addons.zip 将更新 插件.\\n" msgstr "上传 addons*.zip 将更新 插件.\\n"
#: menu.sh:2071 #: menu.sh:2071
msgid "Upload modules.zip will update Modules.\\n" msgid "Upload modules*.zip will update Modules.\\n"
msgstr "上传 modules.zip 将更新 模块.\\n" msgstr "上传 modules*.zip 将更新 模块.\\n"
#: menu.sh:2072 #: menu.sh:2072
msgid "Upload rp-lkms.zip will update LKMs.\\n" msgid "Upload rp-lkms*.zip will update LKMs.\\n"
msgstr "上传 rp-lkms.zip 将更新 LKMs.\\n" msgstr "上传 rp-lkms*.zip 将更新 LKMs.\\n"
#: menu.sh:2121 #: menu.sh:2121
msgid "This person is very lazy and hasn't written anything." msgid "This person is very lazy and hasn't written anything."

View File

@ -1185,20 +1185,20 @@ msgid ""
msgstr "請保持附件名稱與 github 上附件名稱一致.\\n" msgstr "請保持附件名稱與 github 上附件名稱一致.\\n"
#: menu.sh:2069 #: menu.sh:2069
msgid "Upload update.zip will update RR.\\n" msgid "Upload update*.zip will update RR.\\n"
msgstr "上傳 update.zip 将更新 RR.\\n" msgstr "上傳 update*.zip 将更新 RR.\\n"
#: menu.sh:2070 #: menu.sh:2070
msgid "Upload addons.zip will update Addons.\\n" msgid "Upload addons*.zip will update Addons.\\n"
msgstr "上傳 addons.zip 将更新 挿件.\\n" msgstr "上傳 addons*.zip 将更新 挿件.\\n"
#: menu.sh:2071 #: menu.sh:2071
msgid "Upload modules.zip will update Modules.\\n" msgid "Upload modules*.zip will update Modules.\\n"
msgstr "上傳 modules.zip 将更新 模塊.\\n" msgstr "上傳 modules*.zip 将更新 模塊.\\n"
#: menu.sh:2072 #: menu.sh:2072
msgid "Upload rp-lkms.zip will update LKMs.\\n" msgid "Upload rp-lkms*.zip will update LKMs.\\n"
msgstr "上傳 rp-lkms.zip 将更新 LKMs.\\n" msgstr "上傳 rp-lkms*.zip 将更新 LKMs.\\n"
#: menu.sh:2121 #: menu.sh:2121
msgid "This person is very lazy and hasn't written anything." msgid "This person is very lazy and hasn't written anything."

View File

@ -1188,20 +1188,20 @@ msgid ""
msgstr "請保持附件名稱與 Github 上的附件名稱一致。\\n" msgstr "請保持附件名稱與 Github 上的附件名稱一致。\\n"
#: menu.sh:2069 #: menu.sh:2069
msgid "Upload update.zip will update RR.\\n" msgid "Upload update*.zip will update RR.\\n"
msgstr "上傳 update.zip 將更新 RR。\\n" msgstr "上傳 update*.zip 將更新 RR。\\n"
#: menu.sh:2070 #: menu.sh:2070
msgid "Upload addons.zip will update Addons.\\n" msgid "Upload addons*.zip will update Addons.\\n"
msgstr "上傳 addons.zip 將更新增益集。\\n" msgstr "上傳 addons*.zip 將更新增益集。\\n"
#: menu.sh:2071 #: menu.sh:2071
msgid "Upload modules.zip will update Modules.\\n" msgid "Upload modules*.zip will update Modules.\\n"
msgstr "上傳 modules.zip 將更新模組。\\n" msgstr "上傳 modules*.zip 將更新模組。\\n"
#: menu.sh:2072 #: menu.sh:2072
msgid "Upload rp-lkms.zip will update LKMs.\\n" msgid "Upload rp-lkms*.zip will update LKMs.\\n"
msgstr "上傳 rp-lkms.zip 將更新 LKMs。\\n" msgstr "上傳 rp-lkms*.zip 將更新 LKMs。\\n"
#: menu.sh:2121 #: menu.sh:2121
msgid "This person is very lazy and hasn't written anything." msgid "This person is very lazy and hasn't written anything."

View File

@ -2093,13 +2093,13 @@ function updateMenu() {
fi fi
MSG="" MSG=""
MSG+="$(TEXT "Please keep the attachment name consistent with the attachment name on Github.\n")" MSG+="$(TEXT "Please keep the attachment name consistent with the attachment name on Github.\n")"
MSG+="$(TEXT "Upload update.zip will update RR.\n")" MSG+="$(TEXT "Upload update*.zip will update RR.\n")"
MSG+="$(TEXT "Upload addons.zip will update Addons.\n")" MSG+="$(TEXT "Upload addons*.zip will update Addons.\n")"
MSG+="$(TEXT "Upload modules.zip will update Modules.\n")" MSG+="$(TEXT "Upload modules*.zip will update Modules.\n")"
MSG+="$(TEXT "Upload rp-lkms.zip will update LKMs.\n")" MSG+="$(TEXT "Upload rp-lkms*.zip will update LKMs.\n")"
DIALOG --title "$(TEXT "Update")" \ DIALOG --title "$(TEXT "Update")" \
--msgbox "${MSG}" 0 0 --msgbox "${MSG}" 0 0
EXTS=("update.zip" "addons.zip" "modules.zip" "rp-lkms.zip") EXTS=(update*.zip addons*.zip modules*.zip rp-lkms*.zip)
TMP_UP_PATH="${TMP_PATH}/users" TMP_UP_PATH="${TMP_PATH}/users"
USER_FILE="" USER_FILE=""
rm -rf "${TMP_UP_PATH}" rm -rf "${TMP_UP_PATH}"
@ -2108,7 +2108,7 @@ function updateMenu() {
rz -be -B 536870912 rz -be -B 536870912
for F in $(ls -A); do for F in $(ls -A); do
for I in ${EXTS[@]}; do for I in ${EXTS[@]}; do
[[ "${I}" == "${F}" ]] && USER_FILE="${F}" [[ "${F}" = ${I} ]] && USER_FILE="${F}"
done done
break break
done done
@ -2117,15 +2117,21 @@ function updateMenu() {
DIALOG --title "$(TEXT "Update")" \ DIALOG --title "$(TEXT "Update")" \
--msgbox "$(TEXT "Not a valid file, please try again!")" 0 0 --msgbox "$(TEXT "Not a valid file, please try again!")" 0 0
else else
rm -f "${TMP_PATH}/${USER_FILE}" if [[ "${USER_FILE}" = update*.zip ]]; then
mv -f "${TMP_UP_PATH}/${USER_FILE}" "${TMP_PATH}/${USER_FILE}" rm -f "${TMP_PATH}/update.zip"
if [ "${USER_FILE}" = "update.zip" ]; then mv -f "${TMP_UP_PATH}/${USER_FILE}" "${TMP_PATH}/update.zip"
updateRR "RR" updateRR "RR"
elif [ "${USER_FILE}" = "addons.zip" ]; then elif [[ "${USER_FILE}" = addons*.zip ]]; then
rm -f "${TMP_PATH}/addons.zip"
mv -f "${TMP_UP_PATH}/${USER_FILE}" "${TMP_PATH}/addons.zip"
updateExts "addons" "0" updateExts "addons" "0"
elif [ "${USER_FILE}" = "modules.zip" ]; then elif [[ "${USER_FILE}" = modules*.zip ]]; then
rm -f "${TMP_PATH}/modules.zip"
mv -f "${TMP_UP_PATH}/${USER_FILE}" "${TMP_PATH}/modules.zip"
updateExts "modules" "0" updateExts "modules" "0"
elif [ "${USER_FILE}" = "rp-lkms.zip" ]; then elif [[ "${USER_FILE}" = rp-lkms*.zip ]]; then
rm -f "${TMP_PATH}/rp-lkms.zip"
mv -f "${TMP_UP_PATH}/${USER_FILE}" "${TMP_PATH}/rp-lkms.zip"
updateExts "LKMs" "0" updateExts "LKMs" "0"
else else
DIALOG --title "$(TEXT "Update")" \ DIALOG --title "$(TEXT "Update")" \