mirror of
https://github.com/fbelavenuto/arpl.git
synced 2025-12-24 14:52:05 +08:00
Improving the updater to support folders
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
ARPL_VERSION="1.0-beta11"
|
||||
ARPL_VERSION="1.0-beta11a"
|
||||
|
||||
# Define paths
|
||||
TMP_PATH="/tmp"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.0-beta11
|
||||
1.0-beta11a
|
||||
|
||||
Reference in New Issue
Block a user