-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunraid-bottom.plg
96 lines (80 loc) · 2.4 KB
/
unraid-bottom.plg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?xml version='1.0' standalone='yes'?>
<!DOCTYPE PLUGIN [
<!ENTITY name "unraid-bottom">
<!ENTITY author "dtomlinson">
<!ENTITY org "dtomlinson91">
<!ENTITY version "0.6.8">
<!ENTITY gitURL "https://github.com/&org;/&name;">
<!ENTITY pluginURL "&gitURL;/raw/main/&name;.plg">
<!ENTITY releaseURL "&gitURL;/releases/download/&version;/&name;-&version;.txz">
<!ENTITY releaseMD5URL "&gitURL;/releases/download/&version;/md5sum.txt">
<!ENTITY plugin "/boot/config/plugins/&name;">
<!ENTITY emhttp "/usr/local/emhttp/plugins/&name;">
]>
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="6.8.3">
<CHANGES>
## bottom
### 2022-05-06
- Initial release - bottom 0.6.8
</CHANGES>
<FILE Name="&plugin;/&name;-&version;.txz">
<URL>&releaseURL;</URL>
</FILE>
<FILE Name="&plugin;/&name;-&version;.md5">
<URL>&releaseMD5URL;</URL>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
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
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 "*** md5 check successful ***"
fi
</INLINE>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
<!-- remove previous version if present -->
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
</INLINE>
</FILE>
<FILE Run="/bin/bash">
<INLINE>
upgradepkg --install-new &plugin;/&name;-&version;.txz
</INLINE>
</FILE>
<FILE Name="&emhttp;/README.md">
<INLINE>
**bottom**
A customizable cross-platform graphical process/system monitor for the terminal.
For more information see the [bottom repository](https://github.com/ClementTsang/bottom).
</INLINE>
</FILE>
<FILE Run="/bin/bash" Method="remove">
<INLINE>
echo "*** Removing bottom ***"
# Remove plugin related files
removepkg &name;-&version;
rm -rf &emhttp;
rm -rf &plugin;
echo
echo "*** Successfully removed bottom ***"
</INLINE>
</FILE>
</PLUGIN>