remove api.github.com, add model error.

This commit is contained in:
Ing 2023-04-29 00:04:08 +08:00
parent 5b51666895
commit 73d1885bc3
6 changed files with 222 additions and 179 deletions

View File

@ -52,6 +52,11 @@ SN="`readConfigKey "sn" "${USER_CONFIG_FILE}"`"
echo -e "$(TEXT "Model:") \033[1;36m${MODEL}\033[0m"
echo -e "$(TEXT "Build:") \033[1;36m${BUILD}\033[0m"
if [ ! -f "${MODEL_CONFIG_PATH}/${MODEL}.yml" ]; then
echo -e "\033[1;33m*** `printf "$(TEXT "The current version of arpl does not support booting %s-%s, please rebuild.")" "${MODEL}" "${BUILD}"` ***\033[0m"
exit 1
fi
declare -A CMDLINE
# Fixed values

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-04-25 21:28+0800\n"
"POT-Creation-Date: 2023-04-28 23:53+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -58,49 +58,54 @@ msgstr ""
msgid "Build:"
msgstr ""
#: boot.sh:100
#: boot.sh:56
msgid ""
"The current version of arpl does not support booting %s-%s, please rebuild."
msgstr ""
#: boot.sh:105
msgid ""
"Detected %s network cards, but only %s MACs were customized, the rest will "
"use the original MACs."
msgstr ""
#: boot.sh:130
#: boot.sh:135
msgid "Cmdline:\\n"
msgstr ""
#: boot.sh:135
#: boot.sh:140
msgid "Reboot to boot directly in DSM"
msgstr ""
#: boot.sh:140 init.sh:175
#: boot.sh:146 init.sh:175
msgid "Detected %s network cards, Waiting IP."
msgstr ""
#: boot.sh:146 init.sh:181
#: boot.sh:152 init.sh:181
msgid "DOWN"
msgstr ""
#: boot.sh:150 init.sh:185
#: boot.sh:156 init.sh:185
msgid "ERROR"
msgstr ""
#: boot.sh:156
#: boot.sh:162
msgid "Access \\033[1;34mhttp://%s:5000\\033[0m to connect the DSM via web."
msgstr ""
#: boot.sh:165
#: boot.sh:171
msgid "Loading DSM kernel..."
msgstr ""
#: boot.sh:169
#: boot.sh:175
msgid "Warning, running kexec with --noefi param, strange things will happen!!"
msgstr ""
#: boot.sh:174
#: boot.sh:180
msgid "Booting..."
msgstr ""
#: boot.sh:177
#: boot.sh:183
msgid ""
"[This interface will not be operational. Please use the http://find.synology."
"com/ find DSM and connect.]"
@ -216,7 +221,7 @@ msgstr ""
msgid "Please enter a serial number "
msgstr ""
#: menu.sh:206 menu.sh:425 menu.sh:1013 menu.sh:1245
#: menu.sh:206 menu.sh:425 menu.sh:1013 menu.sh:1279
msgid "Alert"
msgstr ""
@ -245,7 +250,7 @@ msgid "Download a external addon"
msgstr ""
#: menu.sh:242 menu.sh:352 menu.sh:464 menu.sh:762 menu.sh:925 menu.sh:1072
#: menu.sh:1294
#: menu.sh:1328
msgid "Exit"
msgstr ""
@ -501,7 +506,7 @@ msgstr ""
msgid "Addon %s not found!"
msgstr ""
#: menu.sh:734 menu.sh:1312
#: menu.sh:734 menu.sh:1346
msgid "Cleaning"
msgstr ""
@ -549,7 +554,7 @@ msgstr ""
msgid "Advanced"
msgstr ""
#: menu.sh:765 menu.sh:1297
#: menu.sh:765 menu.sh:1331
msgid "Choose the option"
msgstr ""
@ -675,7 +680,7 @@ msgstr ""
msgid "Config changed, would you like to rebuild the loader?"
msgstr ""
#: menu.sh:1026 menu.sh:1288
#: menu.sh:1026 menu.sh:1322
msgid "Choose a language"
msgstr ""
@ -687,161 +692,158 @@ msgstr ""
msgid "Choice a keymap"
msgstr ""
#: menu.sh:1067 menu.sh:1077 menu.sh:1082 menu.sh:1088 menu.sh:1092
#: menu.sh:1097 menu.sh:1103 menu.sh:1110 menu.sh:1114 menu.sh:1131
#: menu.sh:1067 menu.sh:1077 menu.sh:1085 menu.sh:1091 menu.sh:1095
#: menu.sh:1100 menu.sh:1106 menu.sh:1113 menu.sh:1117 menu.sh:1134
msgid "Update arpl"
msgstr ""
#: menu.sh:1068 menu.sh:1139 menu.sh:1143 menu.sh:1147 menu.sh:1151
#: menu.sh:1155 menu.sh:1160 menu.sh:1170
#: menu.sh:1068 menu.sh:1142 menu.sh:1150 menu.sh:1156 menu.sh:1160
#: menu.sh:1164 menu.sh:1168 menu.sh:1173 menu.sh:1183
msgid "Update addons"
msgstr ""
#: menu.sh:1069 menu.sh:1175 menu.sh:1179 menu.sh:1183 menu.sh:1187
#: menu.sh:1191 menu.sh:1196
msgid "Update LKMs"
#: menu.sh:1069 menu.sh:1188 menu.sh:1196 menu.sh:1202 menu.sh:1206
#: menu.sh:1210 menu.sh:1225
msgid "Update modules"
msgstr ""
#: menu.sh:1070
msgid "Update modules"
#: menu.sh:1070 menu.sh:1230 menu.sh:1238 menu.sh:1244 menu.sh:1248
#: menu.sh:1252 menu.sh:1256 menu.sh:1261
msgid "Update LKMs"
msgstr ""
#: menu.sh:1071
msgid "Set proxy server"
msgstr ""
#: menu.sh:1078 menu.sh:1140 menu.sh:1176 menu.sh:1201
#: menu.sh:1078 menu.sh:1143 menu.sh:1189 menu.sh:1231
msgid "Checking last version"
msgstr ""
#: menu.sh:1083 menu.sh:1144 menu.sh:1180 menu.sh:1205
#: menu.sh:1086 menu.sh:1151 menu.sh:1197 menu.sh:1239
msgid "Error checking new version"
msgstr ""
#: menu.sh:1089
#: menu.sh:1092 menu.sh:1157 menu.sh:1203 menu.sh:1245
msgid "No new version. Actual version is %s\\nForce update?"
msgstr ""
#: menu.sh:1093
#: menu.sh:1096
msgid "Downloading last version %s"
msgstr ""
#: menu.sh:1098
#: menu.sh:1101
msgid "Error downloading update file"
msgstr ""
#: menu.sh:1104
#: menu.sh:1107
msgid "Error extracting update file"
msgstr ""
#: menu.sh:1111
#: menu.sh:1114
msgid "Checksum do not match!"
msgstr ""
#: menu.sh:1115
#: menu.sh:1118
msgid "Installing new files"
msgstr ""
#: menu.sh:1132
#: menu.sh:1135
msgid "Arpl updated with success to %s!\\nReboot?"
msgstr ""
#: menu.sh:1148 menu.sh:1184 menu.sh:1210
#: menu.sh:1161 menu.sh:1207 menu.sh:1249
msgid "Downloading last version"
msgstr ""
#: menu.sh:1152
#: menu.sh:1165
msgid "Error downloading new version"
msgstr ""
#: menu.sh:1156 menu.sh:1192
#: menu.sh:1169 menu.sh:1257
msgid "Extracting last version"
msgstr ""
#: menu.sh:1161
#: menu.sh:1174
msgid "Installing new addons"
msgstr ""
#: menu.sh:1171
#: menu.sh:1184
msgid "Addons updated with success!"
msgstr ""
#: menu.sh:1188 menu.sh:1214
#: menu.sh:1211 menu.sh:1253
msgid "Error downloading last version"
msgstr ""
#: menu.sh:1197
msgid "LKMs updated with success!"
msgstr ""
#: menu.sh:1200 menu.sh:1204 menu.sh:1209 menu.sh:1213 menu.sh:1228
msgid "Update Modules"
msgstr ""
#: menu.sh:1229
#: menu.sh:1226
msgid "Modules updated with success!"
msgstr ""
#: menu.sh:1234
#: menu.sh:1262
msgid "LKMs updated with success!"
msgstr ""
#: menu.sh:1268
msgid "Set Proxy Server"
msgstr ""
#: menu.sh:1235
#: menu.sh:1269
msgid "Please enter a proxy server url"
msgstr ""
#: menu.sh:1246
#: menu.sh:1280
msgid "Invalid proxy server url, continue?"
msgstr ""
#: menu.sh:1269
#: menu.sh:1303
msgid "Choose a model"
msgstr ""
#: menu.sh:1271
#: menu.sh:1305
msgid "Choose a Build Number"
msgstr ""
#: menu.sh:1272
#: menu.sh:1306
msgid "Choose a serial number"
msgstr ""
#: menu.sh:1274
#: menu.sh:1308
msgid "Addons"
msgstr ""
#: menu.sh:1275
#: menu.sh:1309
msgid "Cmdline menu"
msgstr ""
#: menu.sh:1276
#: menu.sh:1310
msgid "Synoinfo menu"
msgstr ""
#: menu.sh:1279
#: menu.sh:1313
msgid "Advanced menu"
msgstr ""
#: menu.sh:1282
#: menu.sh:1316
msgid "Build the loader"
msgstr ""
#: menu.sh:1286
#: menu.sh:1320
msgid "Boot the loader"
msgstr ""
#: menu.sh:1289
#: menu.sh:1323
msgid "Choose a keymap"
msgstr ""
#: menu.sh:1291
#: menu.sh:1325
msgid "Clean disk cache"
msgstr ""
#: menu.sh:1293
#: menu.sh:1327
msgid "Update menu"
msgstr ""
#: menu.sh:1319
#: menu.sh:1353
msgid "Call \\033[1;32mmenu.sh\\033[0m to return to menu"
msgstr ""

View File

@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: arpl-i18n\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-04-25 21:28+0800\n"
"PO-Revision-Date: 2023-04-25 21:28+0800\n"
"POT-Creation-Date: 2023-04-28 23:53+0800\n"
"PO-Revision-Date: 2023-04-28 23:53+0800\n"
"Last-Translator: ing <wjz304@qq.com>\n"
"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
"Language: zh_CN\n"
@ -57,49 +57,54 @@ msgstr "型号: "
msgid "Build:"
msgstr "版本: "
#: boot.sh:100
#: boot.sh:56
msgid ""
"The current version of arpl does not support booting %s-%s, please rebuild."
msgstr "当前版本的arpl不支持引导 %s-%s, 请重新编译."
#: boot.sh:105
msgid ""
"Detected %s network cards, but only %s MACs were customized, the rest will "
"use the original MACs."
msgstr "检测到 %s 个网卡, 但是仅自定义了 %s 个 MACs, 其他网卡将使用自身 MACs."
#: boot.sh:130
#: boot.sh:135
msgid "Cmdline:\\n"
msgstr "Cmdline:\\n"
#: boot.sh:135
#: boot.sh:140
msgid "Reboot to boot directly in DSM"
msgstr "重启并直接进入DSM引导"
#: boot.sh:140 init.sh:175
#: boot.sh:146 init.sh:175
msgid "Detected %s network cards, Waiting IP."
msgstr "检测到 %s 个网卡, 获取 IP."
#: boot.sh:146 init.sh:181
#: boot.sh:152 init.sh:181
msgid "DOWN"
msgstr "卸载"
#: boot.sh:150 init.sh:185
#: boot.sh:156 init.sh:185
msgid "ERROR"
msgstr "错误"
#: boot.sh:156
#: boot.sh:162
msgid "Access \\033[1;34mhttp://%s:5000\\033[0m to connect the DSM via web."
msgstr "在浏览器中访问 \\033[1;34mhttp://%s:5000\\033[0m 链接 DSM."
#: boot.sh:165
#: boot.sh:171
msgid "Loading DSM kernel..."
msgstr "加载 DSM kernel..."
#: boot.sh:169
#: boot.sh:175
msgid "Warning, running kexec with --noefi param, strange things will happen!!"
msgstr "警告, 使用'--noefi'参数运行'kexec', 可能有不好的事情发生!!"
#: boot.sh:174
#: boot.sh:180
msgid "Booting..."
msgstr "引导中..."
#: boot.sh:177
#: boot.sh:183
msgid ""
"[This interface will not be operational. Please use the http://find.synology."
"com/ find DSM and connect.]"
@ -215,7 +220,7 @@ msgstr "输入SN"
msgid "Please enter a serial number "
msgstr "请输入SN "
#: menu.sh:206 menu.sh:425 menu.sh:1013 menu.sh:1245
#: menu.sh:206 menu.sh:425 menu.sh:1013 menu.sh:1279
msgid "Alert"
msgstr "警告"
@ -244,7 +249,7 @@ msgid "Download a external addon"
msgstr "下载外部插件"
#: menu.sh:242 menu.sh:352 menu.sh:464 menu.sh:762 menu.sh:925 menu.sh:1072
#: menu.sh:1294
#: menu.sh:1328
msgid "Exit"
msgstr "退出"
@ -500,7 +505,7 @@ msgstr "拷贝文件: "
msgid "Addon %s not found!"
msgstr "插件 %s 未找到!"
#: menu.sh:734 menu.sh:1312
#: menu.sh:734 menu.sh:1346
msgid "Cleaning"
msgstr "清除中"
@ -548,7 +553,7 @@ msgstr "持久化arpl的修改"
msgid "Advanced"
msgstr "高级"
#: menu.sh:765 menu.sh:1297
#: menu.sh:765 menu.sh:1331
msgid "Choose the option"
msgstr "设置"
@ -674,7 +679,7 @@ msgstr "无效的YAML格式"
msgid "Config changed, would you like to rebuild the loader?"
msgstr "配置已更改, 是否重新编译引导?"
#: menu.sh:1026 menu.sh:1288
#: menu.sh:1026 menu.sh:1322
msgid "Choose a language"
msgstr "选择语言"
@ -686,161 +691,158 @@ msgstr "选择布局"
msgid "Choice a keymap"
msgstr "选择键盘"
#: menu.sh:1067 menu.sh:1077 menu.sh:1082 menu.sh:1088 menu.sh:1092
#: menu.sh:1097 menu.sh:1103 menu.sh:1110 menu.sh:1114 menu.sh:1131
#: menu.sh:1067 menu.sh:1077 menu.sh:1085 menu.sh:1091 menu.sh:1095
#: menu.sh:1100 menu.sh:1106 menu.sh:1113 menu.sh:1117 menu.sh:1134
msgid "Update arpl"
msgstr "更新arpl"
#: menu.sh:1068 menu.sh:1139 menu.sh:1143 menu.sh:1147 menu.sh:1151
#: menu.sh:1155 menu.sh:1160 menu.sh:1170
#: menu.sh:1068 menu.sh:1142 menu.sh:1150 menu.sh:1156 menu.sh:1160
#: menu.sh:1164 menu.sh:1168 menu.sh:1173 menu.sh:1183
msgid "Update addons"
msgstr "更新插件"
#: menu.sh:1069 menu.sh:1175 menu.sh:1179 menu.sh:1183 menu.sh:1187
#: menu.sh:1191 menu.sh:1196
msgid "Update LKMs"
msgstr "更新LKMs"
#: menu.sh:1070
#: menu.sh:1069 menu.sh:1188 menu.sh:1196 menu.sh:1202 menu.sh:1206
#: menu.sh:1210 menu.sh:1225
msgid "Update modules"
msgstr "更新模块"
#: menu.sh:1070 menu.sh:1230 menu.sh:1238 menu.sh:1244 menu.sh:1248
#: menu.sh:1252 menu.sh:1256 menu.sh:1261
msgid "Update LKMs"
msgstr "更新LKMs"
#: menu.sh:1071
msgid "Set proxy server"
msgstr "设置代理"
#: menu.sh:1078 menu.sh:1140 menu.sh:1176 menu.sh:1201
#: menu.sh:1078 menu.sh:1143 menu.sh:1189 menu.sh:1231
msgid "Checking last version"
msgstr "检测新版本中"
#: menu.sh:1083 menu.sh:1144 menu.sh:1180 menu.sh:1205
#: menu.sh:1086 menu.sh:1151 menu.sh:1197 menu.sh:1239
msgid "Error checking new version"
msgstr "检测新版本错误"
#: menu.sh:1089
#: menu.sh:1092 menu.sh:1157 menu.sh:1203 menu.sh:1245
msgid "No new version. Actual version is %s\\nForce update?"
msgstr "没有新版本. 实际版本为 %s\\n强制更新?"
#: menu.sh:1093
#: menu.sh:1096
msgid "Downloading last version %s"
msgstr "下载新版本 %s 中"
#: menu.sh:1098
#: menu.sh:1101
msgid "Error downloading update file"
msgstr "下载新版本错误"
#: menu.sh:1104
#: menu.sh:1107
msgid "Error extracting update file"
msgstr "更新文件解压错误"
#: menu.sh:1111
#: menu.sh:1114
msgid "Checksum do not match!"
msgstr "Checksum不匹配!"
#: menu.sh:1115
#: menu.sh:1118
msgid "Installing new files"
msgstr "安装更新中"
#: menu.sh:1132
#: menu.sh:1135
msgid "Arpl updated with success to %s!\\nReboot?"
msgstr "Arpl更新成功 %s!\\n重启?"
#: menu.sh:1148 menu.sh:1184 menu.sh:1210
#: menu.sh:1161 menu.sh:1207 menu.sh:1249
msgid "Downloading last version"
msgstr "下载新版本中"
#: menu.sh:1152
#: menu.sh:1165
msgid "Error downloading new version"
msgstr "下载新版本错误"
#: menu.sh:1156 menu.sh:1192
#: menu.sh:1169 menu.sh:1257
msgid "Extracting last version"
msgstr "解压新版本"
#: menu.sh:1161
#: menu.sh:1174
msgid "Installing new addons"
msgstr "安装新插件中"
#: menu.sh:1171
#: menu.sh:1184
msgid "Addons updated with success!"
msgstr "插件更新成功!"
#: menu.sh:1188 menu.sh:1214
#: menu.sh:1211 menu.sh:1253
msgid "Error downloading last version"
msgstr "下载新版本错误"
#: menu.sh:1197
msgid "LKMs updated with success!"
msgstr "LKMs更新成功!"
#: menu.sh:1200 menu.sh:1204 menu.sh:1209 menu.sh:1213 menu.sh:1228
msgid "Update Modules"
msgstr "更新模块"
#: menu.sh:1229
#: menu.sh:1226
msgid "Modules updated with success!"
msgstr "模块更新成功!"
#: menu.sh:1234
#: menu.sh:1262
msgid "LKMs updated with success!"
msgstr "LKMs更新成功!"
#: menu.sh:1268
msgid "Set Proxy Server"
msgstr "设置代理"
#: menu.sh:1235
#: menu.sh:1269
msgid "Please enter a proxy server url"
msgstr "请输入代理服务器url"
#: menu.sh:1246
#: menu.sh:1280
msgid "Invalid proxy server url, continue?"
msgstr "无效的代理服务器url,是否继续?"
#: menu.sh:1269
#: menu.sh:1303
msgid "Choose a model"
msgstr "选择型号"
#: menu.sh:1271
#: menu.sh:1305
msgid "Choose a Build Number"
msgstr "选择版本"
#: menu.sh:1272
#: menu.sh:1306
msgid "Choose a serial number"
msgstr "选择SN"
#: menu.sh:1274
#: menu.sh:1308
msgid "Addons"
msgstr "插件"
#: menu.sh:1275
#: menu.sh:1309
msgid "Cmdline menu"
msgstr "设置Cmdline"
#: menu.sh:1276
#: menu.sh:1310
msgid "Synoinfo menu"
msgstr "设置Synoinfo"
#: menu.sh:1279
#: menu.sh:1313
msgid "Advanced menu"
msgstr "高级设置"
#: menu.sh:1282
#: menu.sh:1316
msgid "Build the loader"
msgstr "编译引导"
#: menu.sh:1286
#: menu.sh:1320
msgid "Boot the loader"
msgstr "启动"
#: menu.sh:1289
#: menu.sh:1323
msgid "Choose a keymap"
msgstr "选择键盘"
#: menu.sh:1291
#: menu.sh:1325
msgid "Clean disk cache"
msgstr "清除磁盘缓存"
#: menu.sh:1293
#: menu.sh:1327
msgid "Update menu"
msgstr "更新"
#: menu.sh:1319
#: menu.sh:1353
msgid "Call \\033[1;32mmenu.sh\\033[0m to return to menu"
msgstr "执行 \\033[1;32mmenu.sh\\033[0m 重新进入设置菜单"

View File

@ -1066,8 +1066,8 @@ function updateMenu() {
dialog --backtitle "`backtitle`" --menu "$(TEXT "Choose a option")" 0 0 0 \
a "$(TEXT "Update arpl")" \
d "$(TEXT "Update addons")" \
l "$(TEXT "Update LKMs")" \
m "$(TEXT "Update modules")" \
l "$(TEXT "Update LKMs")" \
p "$(TEXT "Set proxy server")" \
e "$(TEXT "Exit")" \
2>${TMP_PATH}/resp
@ -1076,14 +1076,17 @@ function updateMenu() {
a)
dialog --backtitle "`backtitle`" --title "$(TEXT "Update arpl")" --aspect 18 \
--infobox "$(TEXT "Checking last version")" 0 0
ACTUALVERSION="${ARPL_VERSION}"
TAG="`curl -k -s "${PROXY}https://api.github.com/repos/wjz304/arpl-i18n/releases/latest" | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`"
if [ $? -ne 0 -o -z "${TAG}" ]; then
# TAG="`curl -skL "${PROXY}https://api.github.com/repos/wjz304/arpl-i18n/releases/latest" | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`"
# In the absence of authentication, the default API access count for GitHub is 60 per hour, so removing the use of api.github.com
LATESTURL="`curl -skL -w %{url_effective} -o /dev/null "${PROXY}https://github.com/wjz304/arpl-i18n/releases/latest"`"
TAG="${LATESTURL##*/}"
[ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}"
if [ -z "${TAG}" ]; then
dialog --backtitle "`backtitle`" --title "$(TEXT "Update arpl")" --aspect 18 \
--msgbox "$(TEXT "Error checking new version")" 0 0
continue
fi
[[ "${TAG:0:1}" == "v" ]] && TAG="${TAG:1}"
ACTUALVERSION="${ARPL_VERSION}"
if [ "${ACTUALVERSION}" = "${TAG}" ]; then
dialog --backtitle "`backtitle`" --title "$(TEXT "Update arpl")" --aspect 18 \
--yesno "`printf "$(TEXT "No new version. Actual version is %s\nForce update?")" "${ACTUALVERSION}"`" 0 0
@ -1092,7 +1095,7 @@ function updateMenu() {
dialog --backtitle "`backtitle`" --title "$(TEXT "Update arpl")" --aspect 18 \
--infobox "`printf "$(TEXT "Downloading last version %s")" "${TAG}"`" 0 0
# Download update file
STATUS=`curl -k -w "%{http_code}" -L "${PROXY}https://github.com/wjz304/arpl-i18n/releases/download/${TAG}/update.zip" -o "/tmp/update.zip"`
STATUS=`curl -kL -w "%{http_code}" "${PROXY}https://github.com/wjz304/arpl-i18n/releases/download/${TAG}/update.zip" -o "/tmp/update.zip"`
if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "$(TEXT "Update arpl")" --aspect 18 \
--msgbox "$(TEXT "Error downloading update file")" 0 0
@ -1138,15 +1141,25 @@ function updateMenu() {
d)
dialog --backtitle "`backtitle`" --title "$(TEXT "Update addons")" --aspect 18 \
--infobox "$(TEXT "Checking last version")" 0 0
TAG=`curl -k -s "${PROXY}https://api.github.com/repos/wjz304/arpl-addons/releases/latest" | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`
if [ $? -ne 0 -o -z "${TAG}" ]; then
# TAG=`curl -skL "${PROXY}https://api.github.com/repos/wjz304/arpl-addons/releases/latest" | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`
# In the absence of authentication, the default API access count for GitHub is 60 per hour, so removing the use of api.github.com
LATESTURL="`curl -skL -w %{url_effective} -o /dev/null "${PROXY}https://github.com/wjz304/arpl-addons/releases/latest"`"
TAG="${LATESTURL##*/}"
[ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}"
if [ -z "${TAG}" ]; then
dialog --backtitle "`backtitle`" --title "$(TEXT "Update addons")" --aspect 18 \
--msgbox "$(TEXT "Error checking new version")" 0 0
continue
fi
ACTUALVERSION="`cat "/mnt/p3/addons/VERSION" 2>/dev/null`"
if [ "${ACTUALVERSION}" = "${TAG}" ]; then
dialog --backtitle "`backtitle`" --title "$(TEXT "Update addons")" --aspect 18 \
--yesno "`printf "$(TEXT "No new version. Actual version is %s\nForce update?")" "${ACTUALVERSION}"`" 0 0
[ $? -ne 0 ] && continue
fi
dialog --backtitle "`backtitle`" --title "$(TEXT "Update addons")" --aspect 18 \
--infobox "$(TEXT "Downloading last version")" 0 0
STATUS=`curl -k -s -w "%{http_code}" -L "${PROXY}https://github.com/wjz304/arpl-addons/releases/download/${TAG}/addons.zip" -o "/tmp/addons.zip"`
STATUS=`curl -kL -w "%{http_code}" "${PROXY}https://github.com/wjz304/arpl-addons/releases/download/${TAG}/addons.zip" -o "/tmp/addons.zip"`
if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "$(TEXT "Update addons")" --aspect 18 \
--msgbox "$(TEXT "Error downloading new version")" 0 0
@ -1171,46 +1184,30 @@ function updateMenu() {
--msgbox "$(TEXT "Addons updated with success!")" 0 0
;;
l)
dialog --backtitle "`backtitle`" --title "$(TEXT "Update LKMs")" --aspect 18 \
--infobox "$(TEXT "Checking last version")" 0 0
TAG=`curl -k -s "${PROXY}https://api.github.com/repos/wjz304/redpill-lkm/releases/latest" | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`
if [ $? -ne 0 -o -z "${TAG}" ]; then
dialog --backtitle "`backtitle`" --title "$(TEXT "Update LKMs")" --aspect 18 \
--msgbox "$(TEXT "Error checking new version")" 0 0
continue
fi
dialog --backtitle "`backtitle`" --title "$(TEXT "Update LKMs")" --aspect 18 \
--infobox "$(TEXT "Downloading last version")" 0 0
STATUS=`curl -k -s -w "%{http_code}" -L "${PROXY}https://github.com/wjz304/redpill-lkm/releases/download/${TAG}/rp-lkms.zip" -o "/tmp/rp-lkms.zip"`
if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "$(TEXT "Update LKMs")" --aspect 18 \
--msgbox "$(TEXT "Error downloading last version")" 0 0
continue
fi
dialog --backtitle "`backtitle`" --title "$(TEXT "Update LKMs")" --aspect 18 \
--infobox "$(TEXT "Extracting last version")" 0 0
rm -rf "${LKM_PATH}/"*
unzip /tmp/rp-lkms.zip -d "${LKM_PATH}" >/dev/null 2>&1
DIRTY=1
dialog --backtitle "`backtitle`" --title "$(TEXT "Update LKMs")" --aspect 18 \
--msgbox "$(TEXT "LKMs updated with success!")" 0 0
;;
m)
dialog --backtitle "`backtitle`" --title "$(TEXT "Update Modules")" --aspect 18 \
dialog --backtitle "`backtitle`" --title "$(TEXT "Update modules")" --aspect 18 \
--infobox "$(TEXT "Checking last version")" 0 0
TAG=`curl -k -s "${PROXY}https://api.github.com/repos/wjz304/arpl-modules/releases/latest" | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`
if [ $? -ne 0 -o -z "${TAG}" ]; then
dialog --backtitle "`backtitle`" --title "$(TEXT "Update Modules")" --aspect 18 \
# TAG=`curl -skL "${PROXY}https://api.github.com/repos/wjz304/arpl-modules/releases/latest" | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`
# In the absence of authentication, the default API access count for GitHub is 60 per hour, so removing the use of api.github.com
LATESTURL="`curl -skL -w %{url_effective} -o /dev/null "${PROXY}https://github.com/wjz304/arpl-modules/releases/latest"`"
TAG="${LATESTURL##*/}"
[ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}"
if [ -z "${TAG}" ]; then
dialog --backtitle "`backtitle`" --title "$(TEXT "Update modules")" --aspect 18 \
--msgbox "$(TEXT "Error checking new version")" 0 0
continue
fi
dialog --backtitle "`backtitle`" --title "$(TEXT "Update Modules")" --aspect 18 \
ACTUALVERSION="`cat "/mnt/p3/modules/VERSION" 2>/dev/null`"
if [ "${ACTUALVERSION}" = "${TAG}" ]; then
dialog --backtitle "`backtitle`" --title "$(TEXT "Update modules")" --aspect 18 \
--yesno "`printf "$(TEXT "No new version. Actual version is %s\nForce update?")" "${ACTUALVERSION}"`" 0 0
[ $? -ne 0 ] && continue
fi
dialog --backtitle "`backtitle`" --title "$(TEXT "Update modules")" --aspect 18 \
--infobox "$(TEXT "Downloading last version")" 0 0
STATUS=`curl -k -s -w "%{http_code}" -L "${PROXY}https://github.com/wjz304/arpl-modules/releases/download/${TAG}/modules.zip" -o "/tmp/modules.zip"`
STATUS=`curl -kL -w "%{http_code}" "${PROXY}https://github.com/wjz304/arpl-modules/releases/download/${TAG}/modules.zip" -o "/tmp/modules.zip"`
if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "$(TEXT "Update Modules")" --aspect 18 \
dialog --backtitle "`backtitle`" --title "$(TEXT "Update modules")" --aspect 18 \
--msgbox "$(TEXT "Error downloading last version")" 0 0
continue
fi
@ -1225,9 +1222,46 @@ function updateMenu() {
done < <(getAllModules "${PLATFORM}" "${KVER}")
fi
DIRTY=1
dialog --backtitle "`backtitle`" --title "$(TEXT "Update Modules")" --aspect 18 \
dialog --backtitle "`backtitle`" --title "$(TEXT "Update modules")" --aspect 18 \
--msgbox "$(TEXT "Modules updated with success!")" 0 0
;;
l)
dialog --backtitle "`backtitle`" --title "$(TEXT "Update LKMs")" --aspect 18 \
--infobox "$(TEXT "Checking last version")" 0 0
# TAG=`curl -skL "${PROXY}https://api.github.com/repos/wjz304/redpill-lkm/releases/latest" | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}'`
# In the absence of authentication, the default API access count for GitHub is 60 per hour, so removing the use of api.github.com
LATESTURL="`curl -skL -w %{url_effective} -o /dev/null "${PROXY}https://github.com/wjz304/redpill-lkm/releases/latest"`"
TAG="${LATESTURL##*/}"
[ "${TAG:0:1}" = "v" ] && TAG="${TAG:1}"
if [ -z "${TAG}" ]; then
dialog --backtitle "`backtitle`" --title "$(TEXT "Update LKMs")" --aspect 18 \
--msgbox "$(TEXT "Error checking new version")" 0 0
continue
fi
ACTUALVERSION="`cat "/mnt/p3/lkms/VERSION" 2>/dev/null`"
if [ "${ACTUALVERSION}" = "${TAG}" ]; then
dialog --backtitle "`backtitle`" --title "$(TEXT "Update LKMs")" --aspect 18 \
--yesno "`printf "$(TEXT "No new version. Actual version is %s\nForce update?")" "${ACTUALVERSION}"`" 0 0
[ $? -ne 0 ] && continue
fi
dialog --backtitle "`backtitle`" --title "$(TEXT "Update LKMs")" --aspect 18 \
--infobox "$(TEXT "Downloading last version")" 0 0
STATUS=`curl -kL -w "%{http_code}" "${PROXY}https://github.com/wjz304/redpill-lkm/releases/download/${TAG}/rp-lkms.zip" -o "/tmp/rp-lkms.zip"`
if [ $? -ne 0 -o ${STATUS} -ne 200 ]; then
dialog --backtitle "`backtitle`" --title "$(TEXT "Update LKMs")" --aspect 18 \
--msgbox "$(TEXT "Error downloading last version")" 0 0
continue
fi
dialog --backtitle "`backtitle`" --title "$(TEXT "Update LKMs")" --aspect 18 \
--infobox "$(TEXT "Extracting last version")" 0 0
rm -rf "${LKM_PATH}/"*
unzip /tmp/rp-lkms.zip -d "${LKM_PATH}" >/dev/null 2>&1
DIRTY=1
dialog --backtitle "`backtitle`" --title "$(TEXT "Update LKMs")" --aspect 18 \
--msgbox "$(TEXT "LKMs updated with success!")" 0 0
;;
p)
RET=1
while true; do

View File

@ -23,8 +23,8 @@ unique: "synology_apollolake_1019+"
dom: 2
serial:
prefix:
- "0000"
middle: "XXX"
- "1850"
middle: "QXR"
suffix: "numeric"
disks: 4
flags: