From 81678d4de5559aef0a4a8e71bf59c6baba808a0d Mon Sep 17 00:00:00 2001 From: ljm42 Date: Tue, 7 Nov 2023 10:23:07 -0700 Subject: [PATCH] plg: update showchanges script --- plugin/plugins/dynamix.unraid.net.plg | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugin/plugins/dynamix.unraid.net.plg b/plugin/plugins/dynamix.unraid.net.plg index ff442003f..2757500f1 100755 --- a/plugin/plugins/dynamix.unraid.net.plg +++ b/plugin/plugins/dynamix.unraid.net.plg @@ -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