Skip to content

Commit

Permalink
fix update check
Browse files Browse the repository at this point in the history
  • Loading branch information
wjz304 committed May 10, 2024
1 parent c114ed6 commit 8b33ed3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions files/initrd/opt/rr/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ initConfigKey "addons.mountloader" "" "${USER_CONFIG_FILE}"
initConfigKey "addons.reboottoloader" "" "${USER_CONFIG_FILE}"
initConfigKey "modules" "{}" "${USER_CONFIG_FILE}"

# for update
if [ -f "${PART2_PATH}/GRUB_VER" ]; then
PLATFORMTMP="$(_get_conf_kv "PLATFORM" "${PART2_PATH}/GRUB_VER")"
MODELTMP="$(_get_conf_kv "MODEL" "${PART2_PATH}/GRUB_VER")"
[ -z "$(readConfigKey "platform" "${USER_CONFIG_FILE}")" ] &&
writeConfigKey "platform" "${PLATFORMTMP,,}" "${USER_CONFIG_FILE}"
[ -z "$(readConfigKey "model" "${USER_CONFIG_FILE}")" ] &&
writeConfigKey "model" "$(echo ${MODELTMP} | sed 's/d$/D/; s/rp$/RP/; s/rp+/RP+/')" "${USER_CONFIG_FILE}"
[ -z "$(readConfigKey "modelid" "${USER_CONFIG_FILE}")" ] &&
writeConfigKey "modelid" "${MODELTMP}" "${USER_CONFIG_FILE}"
fi

if [ ! "LOCALBUILD" = "${LOADER_DISK}" ]; then
_sort_netif "$(readConfigKey "addons.sortnetif" "${USER_CONFIG_FILE}")"

Expand Down
5 changes: 3 additions & 2 deletions update-check.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

# rr
[ ! "rr" = "$(hostname)" ] && exit 1
[ "rr" = "$(hostname)" ] && exit 0 # in RR
[ -f "/usr/rr/VERSION" ] && exit 0 # in DSM

exit 0
exit 1

0 comments on commit 8b33ed3

Please sign in to comment.