Just noticed the plugin is no longer listed under Plugins, and when I navigate to Plugins -> 'Install PluginPlugin File Install Errors' tab, then following is listed:
/boot/config/plugins-error/preclear.disk.plg -> status ERROR
/boot/config/plugins-error/preclear.disk.plg contents are:
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE PLUGIN [
<!ENTITY name "preclear.disk">
<!ENTITY repo "unRAID-plugins">
<!ENTITY author "gfjardim">
<!ENTITY version "2020.05.07">
<!ENTITY launch "Tools/Preclear">
<!ENTITY gitURL "https://raw.githubusercontent.com/&author;/&repo;/master">
<!ENTITY pluginURL "&gitURL;/plugins/&name;.plg">
]>
<PLUGIN name="&name;" author="&author;" launch="&launch;" version="&version;" pluginURL="&pluginURL;" icon="icon-preclear" support="http://lime-technology.com/forum/index.php?topic=39985.0">
<CHANGES>
##&name;
###2020.05.07
- Fix: error showing in the logs for no reason
- Fix: update tmux to 3.1b
- Fix: better CSRF error handling
###2020.05.05a
- Add: dialog package
- Add: <preclear> command line utility to start/stop/watch preclear sessions
###2020.03.14a
- Fix: wrong CSRF token will open an alert instead of trying to update the token in the background
###2020.03.14
- Fix: fix timer name so Unraid can stop/restart webgui updates
- Fix: script - version 1.0.14
- Fix: script - pre-read will ignore read errors so bad sectors can be detected
- Fix: script - write resume info to flash drive timelapse increased from 60 to 120 seconds
###2020.03.06a
- Fix: change the use of system original tail_log to custom tail_log
- Fix: alert user if an action is necessary
- Fix: change the disposition of alert buttons
- Fix: script - version bump to 1.0.13
- Fix: script - change the way elapsed time is computed
- Fix: script - better pause/unpause event handling
###2020.03.02a
- Fix: apply the last fix to the original preclear script and bump version to 1.20
###2020.03.02
- Fix: drives > 2.2TiB and with protective MBR partition starting on sector 64 failing signature verification.
###2020.03.01
- Fix: update swal2 css
###2020.02.27a
- Fix: minor changes
###2020.02.26
- Fix: error while output smart upon script error
- Fix: migrate to SweetAlert v2
- Fix: include Joe L. script by default
###2020.02.17a
- Fix: better diskinfo update handling
- Fix: resume verification will always read the MBR
###2020.02.17
- Fix: reload UD page after Preclear operations
###2020.02.14
- Fix: Write/Erase ops hang if display_pid is reused by the system
###2020.02.13a
- Fix: minor bugfixes
###2020.02.13
- Fix: better queue handling
- Fix: css fixes to grey/azure/black themes
###2020.02.12
- Fix: Increase time lapse before kill a hunged dd process
###2020.01.17b
- Add: Fix Preclear button
###2020.01.17a
- Fix: division by zero on speed calculation
###2020.01.16a
- Fix: disable browser popup open on Start/Resume preclear
###2020.01.16
- Fix: plugin tries to gently stop the preclear script
- Fix: addBannerWarning retrocompatibility
- Add: sorting on Tools > Preclear for Preclear Queue
- Add: Pause/Stop/Resume all
- Fix: script: version 1.0.8
- Fix: script: resume not working while verifying the disk
- Fix: script: correctly compute current speed even if the session is paused/enqueued
- Fix: script: increase ui refresh rate
- Fix: script: better exit handling
###2020.01.14
- Fix: only mark as unsupported if tmux isn't work properly
###2020.01.13
- Fix: prevent mounted disks from appearing at "Start Multiple Sessions"
- Fix: prevent mounted or preclearing disks from being precleared by accident
###2020.01.12
- Fix: properly handle unsupported state
###2020.01.11b
- Fix: add Unraid 6.8.1 support
###2020.01.11
- Add: start multiple preclear sessions
###2020.01.10
- Fix: Unraid 6.8.0 package update
###2019.11.28
- Fix: script version 1.0.6
- Fix: proper debug messages
- Fix: proper exit handling
###2019.11.26
- Fix: increase verbosity in preclear script
###2019.11.22
- Fix: script version 1.0.5
- Fix: 4kn disk drives not formating
- Fix: exporting errors and messages to syslog
- Fix: starting all partitions at sector 64 (avoid partition missalignment)
- Fix: open reports at a new tab
###2019.04.23a
- Fix: Change image icon to font icon if possible
###019.04.23
- Fix: reinstallation failing;
- Fix: change between icon/image if needed.
###2019.04.22a
- Fix: set correct time interval for resume write to flash drive.
###2019.04.22
- Fix: remove ncurses dependency;
- Fix: save resume information to flash drive every 15 minutes to avoid NAND memory wear.
###2019.03.10
- Fix: diskinfo causing high cpu usage.
- Fix: start/stop queue on demand.
- Fix: remove leftover packages
###2019.02.12b
- Fix: queue persistent across reboots
- Fix: better enqueue handling (script 1.0.3)
- Fix: exiting on bad resume file
###2019.02.12
- Add: preclear queue
- Add: download log from each preclear session
###2019.02.11
- Add: preclear log icon to status
- Add: real-time syslog monitoring
###2019.02.10
- Fix: bad substitutionon line 590
###2019.02.06b
- Add: present serial number on notifications
###2019.02.06a
- Fix: footer not appearing
###2019.02.06
- Fix: add unRAID 6.7 support
- Fix: decrease backgroung information pooling
- Fix: script 1.0.1 - commit all resume information to flash drive prior to create the resume file
###2018.10.07
- Fix: remove glyphicon fount dependency
- Fix: vshift in title banners on 6.6.1
- Fix: install full ncurse package depending on stripped version installed (no GCC version dependant)
- Fix: bump preclear script to 1.0.0 (first main version)
###2018.09.20
- Fix: Unraid 6.6 - black theme dropdown ui displaying white-on-white text
###2018.09.17
- Add: resume preclear button
###2018.09.16
- Fix: changed unnamed pipes to named pipes in verify and erase operations (more control over dd process pid and exit status)
- Fix: pre-read now starts at the beggining of the disk
- Add: more verbosity to the log ( progress on write/read operations)
- Add: disk temperature to the page footer
###2018.08.27
- Fix: change 'direct' iflag option to 'nocache' - apparently some hdds don't like it
- Fix: only export initial smart status if not resuming
###2018.08.23
- Fix: not toggling between preclear scripts
###2018.08.22
- Fix: make sure blkid file is created before retrieving dd pid
- FIx: export syslog messages to preclear disk log
###2018.08.21c
- Add: SMART info to preclear log
###2018.08.21b
- Fix: remove fsync option from read/write disk
###2018.08.21a
- Fix: avoid custom version of Tooltipster to load if the official version is present
- Fix: detect wrong csrf_token and update it
- Add: disk log to Tools > Preclear Disk
###2018.08.21
- Fix: diskinfo PHP warnings
- Fix: revert direct I/O usage in dd invocation (reduced write performance)
###2018.08.20
- Fix: increase verbosity of script.
###2018.05.03
- Fix: script not completely zeroing the disk
###2018.04.27
- Fix: script deem failed small dd reads/writes
###018.04.24
- Fix: rc.diskinfo - PHP Warning: Missing argument 2 for force_reload()
- Fix: script not detecting array disks correctly
- Fix: correctly detect dd exit code - may fix link problems hanging preclear operation
- Fix: pause dd if s6-sync (part of s6-utils used by linuxserver) is invoked
###2018.03.29
- Fix: early unRAID 6.5 compatibility
###2017.11.14
- Fix: wrong TMUX being installed on v6.3.5
###2017.11.01
- Fix: remove strings dependency
###2017.09.27
- Fix: diskinfo not starting properly
###2017.09.25
- Fix: install/update not showing the Done button
###2017.09.23
- Fix: diskinfo - PHP Warning: strpos(): Empty needle in /etc/rc.d/rc.diskinfo on line 339
###2017.09.22a
- Fix: update TMUX and add support to 6.4-rc9f
###2017.09.22
- Fix: resume not working due to a bug introduced in 2017.09.20
###2017.09.20
- Fix: better time handling across resumes
###2017.09.19
- Fix: convert popups to Sweet Alert
- Fix: added more verbosity in the preclear script
###2017.09.17a
- Fix: resume not working properly with pre-read
###2017.09.17
- Fix: persistent elapsed time on resumed sessions
###2017.09.16
- Fix: detect dd hang and restart it
- Add: resume stopped preclear session
###2017.07.10
- Add Cron keepalive
###2017.07.08
- Fix: dismiss Statistics status saved at temporary dir;
- Fix: diskinfo 0.1.0 - better array disk detection;
###2017.07.05c
- Fix: diskinfo 0.0.9 - not showing SSD temperature
###2017.07.05b
- Fix: diskinfo 0.0.8 - not properly detect the absent of cached info
###2017.07.05
- Fix: add more files to preclear log download
###2017.07.04
- Fix: diskinfo 0.0.7 - minor bugfixes
###2017.06.30b
- Fix: NVME support?
###2017.06.30a
- Fix: README typo.
###2017.06.30
- Fix: diskinfo 0.0.6 - reload unRAID config every 30 secondsinstead of every 5 seconds;
- Fix: Non-static method should not be called statically (PHP 5.4 error)
###2017.06.27
- Fix: diskinfo 0.0.5 - add compatibility to future Unassigned Devices adoption
###2017.06.24
- Add: present preclear status on footer
###2017.06.23
- Add: diskinfo 0.0.4 - refreshes disk info based on UDEV events
- Add: diskinfo 0.0.4 - detect precleared disks
- Add: preclear_disk 0.8.8 - pause on hdparm/smartctl/sync processes running
- Add: packages to unRAID 6.4
###2017.06.21
- Fix: diskinfo 0.0.3 - suport restart
- Fix: diskinfo daemon restart after update
###2017.06.20
- Fix: tooltips not properly appearing;
- Fix: temperature not showing properly;
- Fix: diskinfo 0.0.2 - timeouts not properly working;
- Fix: script 0.8.7 - pause write every 2% to let SMART queries to complete;
###2017.06.15
- Fix: small bug in diskinfo daemon
###2017.06.14
- Fix: gather information in the background avoiding webgui to freeze
- Fix: script version 0.8.6 - add timeout to 'smartctl' commands
- Fix: Azure theme compatibility
###2017.03.23
- Fix: mismatch short serial numbers - bug introduced in the last version
- Fix: preclear not stopping on Windows browsers
###2017.03.21
- Fix: Plugin not working in older unRAID versions
###2017.02.16
- Fix: pause not working
###2017.02.15
- Fix: more serial fixes
###2017.02.14
- Fix: change identifier from device to serial number
###2017.02.05
- Add: Erase and Preclear function
###2017.02.01
- Add: tooltipster
- Fix: replace buttons to icons
- Fix: disk size wrongly reported
- Fix: log not being reported
###2017.01.27
- Fix: comply with unRAID's XSS and CSRF hardening
###2016.12.24
- Add: increase verbosity of script
###2016.12.23a
- Fix: zero/erase failing due to false exit code
###2016.12.23
- Fix: better log dd errors
###2016.12.21
- Add: Secure Erase disk
###2016.12.20a
- Fix: remove send statistics
###2016.12.20
- Fix: recompile TOR package, avoiding logrotate error
- Add: TOR SlackBuild sources to GitHub
###2016.12.19
- Add: send statistics;
- Add: tor package;
- Fix: removed array disk appearing as unavailable disk;
- Fix: install correct packages on unRAID 6.3
- Fix: script - better error reporting;
###2016.10.31
- Add: generate some debug info
###2016.10.29
- Fix: small bug in script display
- Fix: Array disks connected to Areca cards showing up
- Fix: Detect if script author is Joe L. or bjp999
- Add: script write errors to log file
- Add: Download log file from the webui
###2016.10.26
- Add: Copy to Clipboard button on Preview window
- Fix: unescaped quotes breaking read of "state.ini" file
- Fix: remove PHP "split" function due deprecation
- Fix: script - better SMART detection
- Fix: script - greatly improve speed and memory footprint in read operations
- Fix: script - faster display refresh
###2016.09.27
- Fix: better PHP exception handling.
###2016.09.26b
- Fix: not loading information if /boot/preclear_reports directory doesn't exist
###2016.09.26a
- Fix: prepare better Unassigned Devices integration
###2016.09.25
- Fix: utempter depencency not installed
- Add: "Answer Yes" button on Joe L. script if needed.
- Add: preclear command to show status on shell
###2016.09.23a
- Fix: script error appearing if SMART is not available
###2016.09.23
- Add: show reports of listed disks;
- Fix: page scrolling while updating;
- Fix: make link point to Tools;
- Fix: increase disk column width;
- Fix: better script report.
###2016.09.11
- Fix: better report formating
###016.09.10
- Fix: preclear report not being created due to filename invalid characters.
###2016.08.29
- Fix: slow read with custom settings
###2016.08.28
- Fix: create temp folder on plugin installation
###2016.08.26
- Fix: merge beta script
- Fix: high memory consumption
###2016.06.23
- Fix: install utempter
###2016.06.22
- Add: Notification capability
- Fix: Move Preclear icon to Tools
- Fix: Fix unknown terminal "screen" error
- Fix: Preclear script not reading the end of the disk
- Update: tmux (2.1), libevent (2.0.22) and ncurses (5.9-4)
###2016.03.24a
- Fix: better smartctl device testing
###2016.03.24
- Fix: displaying negative numbers
###2016.03.22
- Fix: Better S.M.A.R.T. report
- Add: Save a report in /boot/preclear_reports
###2016.03.21
- Add: pause any preclear operations while array start/stop
- Add: Initial SMART reporting
###2016.03.20
- Fix: disk detected as part of the array if cache slot was empty
###2016.03.11b
- Add: New Preclear script
- Forked: to beta
###2015.11.18
- Add: logging capabilities
- Fix: php error if disk.cfg file doesn't exist
###2015.09.28a
- Fix: DVD/BluRay drives being included
- Fix: some minor bugs
###2015.09.18
- Fix: Areca disks not appearing correctly.
###2015.09.17b
- Fix: black CSS conformity
###2015.09.17
- Release: maintenance release.
###2015.09.08
- Add: ncurses package, avoiding the use of the xterm hack.
###2015.09.07d
- Improvement: better integration with Unassigned Devices.
- Fix: unRAID 6.1.1 doesn't have a 'screen' terminal descriptor; xterm used instead.
###2015.08.12
- Fix: 6.1-rc3 compatibility
###2015.07.23
- Fix: better unRAID 6.1 compatibility
- Fix: clearer notification system
###2015.07.21
- Fix: unRAID 6.1-rc1 compatibility
###2015.06.16
- Fix: duplicate hdd entry due to udev's duplicate links
###2015.06.15
- Fix: minor bugfixes
###2015.06.13
- Fix: remove ^n markup from preclear status
- Fix: show a wait message while preclear is starting
- Fix: add MD5 verification to downloaded files
- Fix: remove the Start Preclear link if an tmux session is already open
###2015.05.20b
- Minor bugfixes
###2015.05.20a
- Add support to bjp999 version
###2015.05.20
- Remove preclear script from package. It must be manually added to /boot/config/plugins/preclear.disk/ directory.
###2015.05.18b
- Fix: empty cacheId variable crashing the code
###2015.05.18a
- Fix: plugin not appearing under Settings/Utilities
###2015.05.18
- Add: fast preclear option (bjp999 mod)
###2015.05.17a
- Improve: detection of SCSI disks
###2015.05.16a
- Add: other preclear operations
###2015.05.16
- Initial release.
</CHANGES>
<!--
The 'plugin' package file.
-->
<FILE Name="/boot/config/plugins/&name;/&name;-&version;.txz">
<URL>&gitURL;/archive/&name;-&version;.txz</URL>
</FILE>
<!--
The 'plugin' package MD5 hash.
-->
<FILE Name="/boot/config/plugins/&name;/&name;-&version;.md5">
<URL>&gitURL;/archive/&name;-&version;.md5</URL>
</FILE>
<!--The 'readvz' executable.-->
<FILE Name="/usr/local/sbin/readvz" Mode="755">
<URL>&gitURL;/source/packages/readvz</URL>
</FILE>
<!--The 'dialog' install package.-->
<FILE Name="/boot/config/plugins/&name;/dialog-1.3_20200327-x86_64-1.txz" Mode="666">
<URL>&gitURL;/source/packages/dialog-1.3_20200327-x86_64-1.txz</URL>
<MD5>f7de2c4a0984e8f0e32a2140845dc862</MD5>
</FILE>
<!--The 'preclear_disk_ori.sh' script.-->
<FILE Name="/usr/local/sbin/preclear_disk_ori.sh" Mode="755">
<URL>&gitURL;/source/packages/preclear_disk_20.sh</URL>
</FILE>
<!--
The 'packages-install' script.
-->
<FILE Run="/bin/bash">
<INLINE>
unsupported="/var/state/&name;/unsupported"
# Creating some directories
mkdir -p /tmp/.preclear/ /usr/local/bin/ /var/state/&name;/
download_install() {
local dest="/boot/config/plugins/&name;/${2}"
local src="&gitURL;/source/packages/${2}"
local pkg=$(echo "${2}" | rev | cut -f 3- -d '-' | cut -d '-' -f2- | rev)
local ver=$(echo "${2}" | rev | cut -f 3- -d '-' | cut -d '-' -f1 | rev)
local md5=$1
if [ ! -f "${dest}" ]; then
curl --location --silent --fail "${src}" --output "${dest}"
fi
file_md5=$(/usr/bin/md5sum ${dest})
if [ "${file_md5:0:32}" != "${md5:0:32}" ]; then
echo "Wrong '${2}' package md5 hash."
rm "${dest}"
exit 1
fi
while read p; do
local _pkg=$(echo "$p" | rev | cut -f 3- -d '-' | cut -d '-' -f2- | rev)
if [ "$pkg" == "$_pkg" ]; then
local ipkg=$_pkg
local iver=$(echo "$p" | rev | cut -f 3- -d '-' | cut -d '-' -f1 | rev)
break
fi
done < <(find /var/lib/pkgtools/packages/ -type f -printf '%P\n')
if [ -n "$ipkg" ]; then
if php -r "exit((version_compare('$ver','$iver', '>=') ) ? 0 : 1);"; then
echo "$pkg version $ver is greater or equal than the installed version ($iver), installing..."
/sbin/upgradepkg --install-new "$dest"
else
echo "$pkg version $ver is lower than the installed version ($iver), aborting..."
echo "$pkg version $ver is lower than the installed version ($iver), aborting..." | logger -t "root: plugin: &name;.plg"
fi
else
echo "installing package $pkg version $ver...."
echo "installing package $pkg version $ver...." | logger -t "root: plugin: &name;.plg"
/sbin/upgradepkg --install-new "$dest"
fi
}
is_unraid_version() {
if [ -f "/etc/unraid-version" ]; then
. /etc/unraid-version
else
version="0.0"
fi
return $( php -r "echo ( version_compare('$version','$2', '$1') ) ? 0 : 1;" )
}
if [ -f "$unsupported" ]; then
rm "$unsupported"
fi
if is_unraid_version '>=' '6.5.3' && is_unraid_version '<' '6.6.3'; then
# download_install c04358fd7d7cb0b5ca67f215871f3692 ncurses-6.0-x86_64-3.txz
download_install 9ba9d61dcd90d45719d27b9e7a111913 libevent-2.1.8-x86_64-1.txz
download_install a48783401331620b7c7e5d7af58f53db tmux-2.5-x86_64-1.txz
download_install aed1f39d4a5acddb225b542145e0eeaf utempter-1.1.6-x86_64-2.txz
elif is_unraid_version '>=' '6.6.3' && is_unraid_version '<' '6.7'; then
# download_install 96ebaee8f6a62f220dbdf4723a81e535 ncurses-6.1_20180324-x86_64-1.txz
download_install 9ba9d61dcd90d45719d27b9e7a111913 libevent-2.1.8-x86_64-1.txz
download_install a4a7fdd5ff9910bee3477a2aa0e5fa25 tmux-2.7-x86_64-1.txz
download_install aed1f39d4a5acddb225b542145e0eeaf utempter-1.1.6-x86_64-2.txz
elif is_unraid_version '>=' '6.7' && is_unraid_version '<' '6.8.0-rc1'; then
# download_install 007c068e334c2358621d3d1ea959da80 ncurses-6.1_20190112-x86_64-1.txz
download_install 4e76295aad8c9bf8c98301a9b7ec2e64 libevent-2.1.8-x86_64-3.txz
download_install 00d6b305ad4f01504a9419dd959e8cce openssl10-solibs-1.0.2o-x86_64-1.txz
download_install a40eef8aa01885ff6ea592a7e8e6b2da tmux-2.8-x86_64-1.txz
download_install 1af347c4d9feff774320d9c1e7920ac3 utempter-1.1.6-x86_64-3.txz
elif is_unraid_version '>=' '6.8.0-b1' && is_unraid_version '<' '6.8.3'; then
download_install 7dabee590ed5b5e47b17480dec367636 tmux-3.0a-x86_64-1.txz
download_install a6e7015c850fcfc5a56f42b740c0a4ba libevent-2.1.11-x86_64-1.txz
download_install 1af347c4d9feff774320d9c1e7920ac3 utempter-1.1.6-x86_64-3.txz
elif is_unraid_version '>=' '6.8.3'; then
download_install c8367090c89d26690be706c7fb3db5fc tmux-3.1b-x86_64-1.txz
download_install a6e7015c850fcfc5a56f42b740c0a4ba libevent-2.1.11-x86_64-1.txz
download_install 1af347c4d9feff774320d9c1e7920ac3 utempter-1.1.6-x86_64-3.txz
else
echo "unRAID version ($version) not supported."
echo "unRAID version ($version) not supported." | logger -t "root: plugin: &name;.plg"
touch "$unsupported"
fi
# Fix tmux tmp directory if needed
if [ ! -d "/tmp/tmux-0" ]; then
mkdir /tmp/tmux-0
fi
chmod 700 /tmp/tmux-0
chown -R root:root /tmp/tmux-0
# Verify if tmux is working correctly
/usr/bin/tmux new-session -d -x 140 -y 200 -s "install_test_session" &>/dev/null
sleep 0.5
/usr/bin/tmux kill-session -t "install_test_session" &>/dev/null
if [ $? -ne 0 ]; then
echo "tmux is not working properly"
echo "tmux is not working properly" | logger -t "root: plugin: &name;.plg"
touch "$unsupported"
fi
# Verify and install plugin package
sum1=$(/usr/bin/md5sum /boot/config/plugins/&name;/&name;-&version;.txz)
sum2=$(/usr/bin/cat /boot/config/plugins/&name;/&name;-&version;.md5)
if [ "${sum1:0:32}" != "${sum2:0:32}" ]; then
echo "Wrong 'plugin' package md5 hash."
rm /boot/config/plugins/&name;/&name;-&version;.txz
rm /boot/config/plugins/&name;/&name;-&version;.md5
exit 1
else
for old in $(find /var/lib/pkgtools/packages/ -iname "preclear.disk-*"); do
removepkg "$old"
done
upgradepkg --install-new /boot/config/plugins/&name;/&name;-&version;.txz
fi
</INLINE>
</FILE>
<!--
The 'post-install' script.
-->
<FILE Run="/bin/bash">
<INLINE>
# Create a symlink to /root/mdcmd
if [[ ! -e /root/mdcmd ]]; then
ln -sf /usr/local/sbin/mdcmd /root/mdcmd
fi
#dismissed="/boot/config/plugins/statistics.sender/dismissed"
#version_dismiss="/boot/config/plugins/&name;/statistics.sender.dismissed-&version;"
#if [ ! -f "$version_dismiss" ]; then
# rm -f "$dismissed"
# touch "$version_dismiss"
#fi
# Make sure log file exists
touch /var/log/preclear.disk.log
# Set correct terminal type for TMUX
echo "set -g default-terminal '$TERM'" > /root/.tmux.conf
# Update file access mode
chmod 644 $(awk '/\.(htm|php|js|page|css|png|plg|gif|cfg|md)$/ {print "/"$0}' /var/log/packages/&name;-&version;)
chmod -R 755 /usr/local/emhttp/plugins/&name;/script/
ln -sf /usr/local/emhttp/plugins/&name;/script/preclear.sh /usr/local/bin/preclear
# Install diskinfo service
cp /usr/local/emhttp/plugins/&name;/rc.diskinfo /etc/rc.d/rc.diskinfo
chmod +x /etc/rc.d/rc.diskinfo
# Add CRON entry to keep alive
cat <<'EOT' > /etc/cron.d/diskinfo
# Diskinfo daemon keepalive
*/1 * * * * /etc/rc.d/rc.diskinfo --daemon &> /dev/null
EOT
chmod 600 /etc/cron.d/diskinfo
# Add UDEV rule
mv /usr/local/emhttp/plugins/&name;/99_diskinfo.rules /etc/udev/rules.d/99_diskinfo.rules
chmod 644 /etc/udev/rules.d/99_diskinfo.rules
udevadm control --reload-rules
# Cleaning old source files
find /boot/config/plugins/&name;/ -type f -iname "&name;*.txz" ! -iname "*&version;*" -delete
find /boot/config/plugins/&name;/ -type f -iname "&name;*.md5" ! -iname "*&version;*" -delete
find /boot/config/plugins/&name;/ -type f -iname "tor-*.txz" -delete
# Start diskinfo
/etc/rc.d/rc.diskinfo --quit &>/dev/null
rm -f /var/local/emhttp/plugins/diskinfo/diskinfo.json &>/dev/null
echo "sleep 5 ; /etc/rc.d/rc.diskinfo --daemon &>/dev/null" | at now &>/dev/null
# Plugin version
echo "&version;" > /var/state/preclear.disk/version
echo ""
echo "-----------------------------------------------------------"
echo " &name; has been installed."
echo " Copyright 2015-2020, gfjardim"
echo " Version: &version;"
echo "-----------------------------------------------------------"
echo ""
</INLINE>
</FILE>
<!--
Change image icon to font icon if possible
-->
<FILE Run="/usr/bin/at -M now 2>/dev/null ">
<INLINE>
#!/bin/bash
# Change PNG icon to SVG icon if possible
font_file="/usr/local/emhttp/webGui/styles/font-unraid.svg"
if [ -f "$font_file" ]; then
icon_exists=$(grep -c "preclear" "$font_file" 2>/dev/null)
if [ "$icon_exists" -gt 0 ]; then
sed -i -e 's/preclear.disk.png/icon-preclear/g' /usr/local/emhttp/plugins/&name;/Preclear.page
sed -i -e '/^---/i Tag=\"icon-preclear\"' /usr/local/emhttp/plugins/&name;/Preclear.page
elif [ "$icon_exists" -eq 0 ]; then
sleep 5
sed -i -e 's/icon=\"icon-preclear\"//g' /boot/config/plugins/&name;.plg
fi
fi
</INLINE>
</FILE>
<!--
The 'remove' script.
-->
<FILE Run="/bin/bash" Method="remove">
<INLINE>
# kill all preclear sessions
/usr/local/emhttp/plugins/&name;/script/clear_preclear.sh
# Remove plugin
removepkg &name;-&version;
# Remove diskinfo
rm /etc/cron.d/diskinfo
sleep 1
/etc/rc.d/rc.diskinfo --quit
rm /var/local/emhttp/plugins/diskinfo/diskinfo.json \
/etc/rc.d/rc.diskinfo \
/etc/udev/rules.d/99_diskinfo.rules
udevadm control --reload-rules
# Remove plugin related files
rm -f /usr/local/bin/preclear \
/var/run/preclear_queue.pid \
/var/log/preclear.disk.log \
/usr/local/sbin/preclear_disk_ori.sh \
/usr/local/sbin/readvz
# Remove plugin related directories
rm -rf /boot/config/plugins/&name; \
/usr/local/emhttp/plugins/&name; \
/var/state/&name; \
/boot/.preclear \
/tmp/.preclear
echo ""
echo "-----------------------------------------------------------"
echo " &name; has been uninstalled."
echo " Please reboot your server to complete uninstall this plugin."
echo " Copyright 2015-2020, gfjardim"
echo " Version: &version;"
echo "-----------------------------------------------------------"
echo ""
exit 0
</INLINE>
</FILE>
</PLUGIN>
Any idea what's the deal?