Improving the updater to support folders

This commit is contained in:
Fabio Belavenuto
2023-01-12 19:42:15 -03:00
parent b52afda06b
commit 269d3a3efe
7 changed files with 43 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
ARPL_VERSION="1.0-beta11"
ARPL_VERSION="1.0-beta11a"
# Define paths
TMP_PATH="/tmp"

View File

@@ -1026,14 +1026,20 @@ function updateMenu() {
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--infobox "Installing new files" 0 0
# Process update-list.yml
while IFS="=" read KEY VALUE; do
mkdir -p "`dirname "${VALUE}"`"
mv /tmp/`basename "${KEY}"` "${VALUE}"
done < <(readConfigMap "replace" "/tmp/update-list.yml")
while read F; do
[ -f "${F}" ] && rm -f "${F}"
[ -d "${F}" ] && rm -Rf "${F}"
done < <(readConfigArray "remove" "/tmp/update-list.yml")
while IFS="=" read KEY VALUE; do
if [ "${KEY: -1}" = "/" ]; then
rm -Rf "${VALUE}"
mkdir -p "${VALUE}"
gzip -dc "/tmp/`basename "${KEY}"`.tgz" | tar xf - -C "${VALUE}"
else
mkdir -p "`dirname "${VALUE}"`"
mv "/tmp/`basename "${KEY}"`" "${VALUE}"
fi
done < <(readConfigMap "replace" "/tmp/update-list.yml")
dialog --backtitle "`backtitle`" --title "Update arpl" --aspect 18 \
--yesno "Arpl updated with success to ${TAG}!\nReboot?" 0 0
[ $? -ne 0 ] && continue

View File

@@ -1 +1 @@
1.0-beta11
1.0-beta11a