From 66dbfbbec26404d3d45baf7a84a621b11cfff1ca Mon Sep 17 00:00:00 2001 From: Daniel Tomlinson Date: Sat, 7 May 2022 04:23:07 +0100 Subject: [PATCH] update installation script --- dev.unraid-rip.plg | 52 ++++++++++++++++++++++++++++++++++------------ unraid-rip.plg | 52 ++++++++++++++++++++++++++++++++++------------ 2 files changed, 78 insertions(+), 26 deletions(-) diff --git a/dev.unraid-rip.plg b/dev.unraid-rip.plg index 040d414..d4f11c9 100644 --- a/dev.unraid-rip.plg +++ b/dev.unraid-rip.plg @@ -7,7 +7,7 @@ - + ]> @@ -22,26 +22,52 @@ + +&releaseURL; + + + +&releaseMD5URL; + + - -file=$(/usr/bin/ls /boot/config/plugins/&name;/&name;*.txz | grep -v '&version;') -if [ ! -z "$file" ] +local_package_file_md5=$(/usr/bin/md5sum &plugin;/&name;-&version;.txz) +remote_package_file_md5=$(/usr/bin/cat &name;-&version;.md5) + +if test $local_package_file_md5 != remote_package_file_md5 then - filename=$(basename -- $file) - previous="${filename%.*}" - echo "previous version ${previous} found - uninstalling" - removepkg $previous - rm -f $file + echo "*** md5 of download package does not match - removing files and exiting ***" + rm &plugin;/&name;-&version;.txz + rm &name;-&version;.md5 + exit 1 else - echo "no previous version found - first time install" + echo "*** md5 check successful ***" fi - -&releaseURL; -&md5; + + + + file=$(/usr/bin/ls /boot/config/plugins/&name;/&name;*.txz | grep -v '&version;') + if [ ! -z "$file" ] + then + filename=$(basename -- $file) + previous="${filename%.*}" + echo "*** previous version ${previous} found - uninstalling ***" + removepkg $previous + rm -f $file + else + echo "*** no previous version found - first time install ***" + fi + + + + + +upgradepkg --install-new &plugin;/&name;-&version;.txz + diff --git a/unraid-rip.plg b/unraid-rip.plg index c40e1ad..ec14d5f 100644 --- a/unraid-rip.plg +++ b/unraid-rip.plg @@ -7,7 +7,7 @@ - + ]> @@ -21,26 +21,52 @@ + +&releaseURL; + + + +&releaseMD5URL; + + - -file=$(/usr/bin/ls /boot/config/plugins/&name;/&name;*.txz | grep -v '&version;') -if [ ! -z "$file" ] +local_package_file_md5=$(/usr/bin/md5sum &plugin;/&name;-&version;.txz) +remote_package_file_md5=$(/usr/bin/cat &name;-&version;.md5) + +if test $local_package_file_md5 != remote_package_file_md5 then - filename=$(basename -- $file) - previous="${filename%.*}" - echo "previous version ${previous} found - uninstalling" - removepkg $previous - rm -f $file + echo "*** md5 of download package does not match - removing files and exiting ***" + rm &plugin;/&name;-&version;.txz + rm &name;-&version;.md5 + exit 1 else - echo "no previous version found - first time install" + echo "*** md5 check successful ***" fi - -&releaseURL; -&md5; + + + + file=$(/usr/bin/ls /boot/config/plugins/&name;/&name;*.txz | grep -v '&version;') + if [ ! -z "$file" ] + then + filename=$(basename -- $file) + previous="${filename%.*}" + echo "*** previous version ${previous} found - uninstalling ***" + removepkg $previous + rm -f $file + else + echo "*** no previous version found - first time install ***" + fi + + + + + +upgradepkg --install-new &plugin;/&name;-&version;.txz +