„dvb-driver.plg“ ändern

This commit is contained in:
2021-07-29 21:06:36 +02:00
parent 384df5339c
commit 46497bef7b

View File

@@ -2,16 +2,13 @@
<!DOCTYPE PLUGIN [
<!ENTITY name "dvb-driver">
<!ENTITY author "ich777">
<!ENTITY version "2021.07.29">
<!ENTITY version "2021.07.29a">
<!ENTITY launch "Settings/dvb-driver">
<!ENTITY gitURL "https://github.com/&author;/unraid-&name;/raw/master">
<!ENTITY pluginURL "&gitURL;/&name;.plg">
<!ENTITY md5 "68ae553107aadb7880d791e24efadd61">
<!ENTITY plugin "/boot/config/plugins/&name;">
<!ENTITY emhttp "/usr/local/emhttp/plugins/&name;">
<!ENTITY upd_v "2021.07.29">
<!ENTITY upd_url "https://raw.githubusercontent.com/ich777/unraid-plugin_update_helper/master/&upd_v;/plugin_update_helper">
<!ENTITY upd_md5 "0f447e3368a2ec2a55a282e1b8775430">
]>
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;" min="6.9.0-beta31" support="https://forums.unraid.net/topic/99027-plugin-dvb-driver/">
@@ -19,7 +16,7 @@
<CHANGES>
###2021.07.29
###2021.07.29a
- Added Plugin Update Helper when up-/downgrading unRAID version
###2021.06.23
@@ -84,11 +81,6 @@ rm -f $(ls /boot/config/plugins/&name;/&name;*.txz 2>/dev/null|grep -v '&version
<MD5>&md5;</MD5>
</FILE>
<FILE Name="/tmp/pluginupdatehelper/plgupdhlp">
<URL>&upd_url;</URL>
<MD5>&upd_md5;</MD5>
</FILE>
<FILE Name="&emhttp;/README.md">
<INLINE>
**DVB Driver**
@@ -182,19 +174,37 @@ udevadm control --reload 2>/dev/null &amp;&amp; udevadm trigger --action=add 2>/
check_package
install_package >/dev/null
#Check if downloaded Plugin Update Helper is installed and up-to-date
if [ ! -f /usr/bin/plugin_update_helper ]; then
cp /tmp/pluginupdatehelper/plgupdhlp /usr/bin/plugin_update_helper
chmod +x /usr/bin/plugin_update_helper
#Check if Plugin Update Helper is downloaded and up-to-date
if [ ! -f &plugin;/plugin_update_helper ]; then
wget -q -T 5 -O &plugin;/plugin_update_helper "https://raw.githubusercontent.com/ich777/unraid-plugin_update_helper/master/plugin_update_helper"
chmod +x &plugin;/plugin_update_helper
else
DL_V="$(grep -E "Plugin-Update-Helper version:" /tmp/pluginupdatehelper/plgupdhlp | awk '{print $4}')"
CUR_V="$(grep -E "Plugin-Update-Helper version:" /usr/bin/plugin_update_helper | awk '{print $4}')"
COMPARE="$(sort -V &lt;(echo -e "${DL_V}\n$CUR_V") | tail -1)"
if [ "$CUR_V" != "$COMPARE" ]; then
CUR_V="$(grep -E "Plugin-Update-Helper version:" &plugin;/plugin_update_helper | awk '{print $4}')"
if [ ! -s /tmp/update-helper ]; then
echo "$(wget -T5 -qO- https://raw.githubusercontent.com/ich777/unraid-plugin_update_helper/master/plugin_update_helper | grep -E "Plugin-Update-Helper version:" | awk '{print $4}')" > /tmp/update-helper
AVAIL_V="$(cat /tmp/update-helper)"
else
AVAIL_V="$(cat /tmp/update-helper)"
fi
if [ ! -z "$AVAIL_V" ]; then
COMPARE="$(sort -V &lt;(echo -e "${AVAIL_V}\n$CUR_V") | tail -1)"
if [ "$CUR_V" != "$COMPARE" ]; then
wget -q -T 5 -O &plugin;/plugin_update_helper "https://raw.githubusercontent.com/ich777/unraid-plugin_update_helper/master/plugin_update_helper"
fi
fi
fi
#Check if Plugin Update Helper is installed and up to date
if [ ! -f /usr/bin/plugin_update_helper ]; then
cp &plugin;/plugin_update_helper /usr/bin/plugin_update_helper
else
PLUGIN_V="$(grep -E "Plugin-Update-Helper version:" &plugin;/plugin_update_helper | awk '{print $4}')"
INST_V="$(grep -E "Plugin-Update-Helper version:" /usr/bin/plugin_update_helper | awk '{print $4}')"
COMPARE="$(sort -V &lt;(echo -e "${PLUGIN_V}\n$INST_V") | tail -1)"
if [ "$INST_V" != "$COMPARE" ]; then
kill $(ps aux | grep -E "inotifywait -q /boot/changes.txt -e move_self,delete_self" | head -n -1 | awk '{print $2}') 2>/dev/null
sleep 1
cp /tmp/pluginupdatehelper/plgupdhlp /usr/bin/plugin_update_helper
chmod +x /usr/bin/plugin_update_helper
cp &plugin;/plugin_update_helper /usr/bin/plugin_update_helper
fi
fi