plg: update showchanges script

This commit is contained in:
ljm42
2023-11-07 10:23:07 -07:00
committed by Zack Spear
parent 032fd9853e
commit 81678d4de5

View File

@@ -315,6 +315,7 @@ if [ -e /etc/rc.d/rc.unraid-api ]; then
FILE=/usr/local/emhttp/plugins/dynamix/include/UpdateDNS.php && [[ -f "$FILE-" ]] && mv -f "$FILE-" "$FILE"
FILE=/usr/local/emhttp/plugins/dynamix.plugin.manager/Downgrade.page && [[ -f "$FILE-" ]] && mv -f "$FILE-" "$FILE"
FILE=/usr/local/emhttp/plugins/dynamix.plugin.manager/Update.page && [[ -f "$FILE-" ]] && mv -f "$FILE-" "$FILE"
FILE=/usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/showchanges && [[ -f "$FILE-" ]] && mv -f "$FILE-" "$FILE"
FILE=/usr/local/emhttp/plugins/dynamix.my.servers/MyServers.page && [[ -f "$FILE-" ]] && mv -f "$FILE-" "$FILE"
FILE=/usr/local/emhttp/plugins/dynamix.my.servers/Registration.page && [[ -f "$FILE-" ]] && mv -f "$FILE-" "$FILE"
FILE=/usr/local/emhttp/plugins/dynamix.my.servers/include/myservers1.php && [[ -f "$FILE-" ]] && mv -f "$FILE-" "$FILE"
@@ -444,6 +445,16 @@ if [[ -n $LINENUM ]]; then
mv -f "$FILE~" "$FILE"
fi
# patch showchanges script, starting with 6.11.0-rc1
# search text: $valid = ['/var/tmp/','/tmp/plugins/'];
# replacement text: $valid = ['/var/tmp/','/tmp/plugins/','/boot/previous'];
FILE=/usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/showchanges
if test -f "${FILE}" && ! grep -q "'/boot/previous'" "${FILE}" &>/dev/null; then
# backup the file so it can be restored later
cp -f "$FILE" "$FILE-"
sed -i '/$valid = \[/c$valid = ['"'/var/tmp/'"','"'/tmp/plugins/'"','"'/boot/previous'"'];' "$FILE"
fi
# move settings on flash drive
CFG_OLD=/boot/config/plugins/Unraid.net
CFG_NEW=/boot/config/plugins/dynamix.my.servers