run divert if file exists and has bin/sh in it
Signed-off-by: Aaron Murray <plugins@omv-extras.org>
This commit is contained in:
parent
346bbe6460
commit
b0f8f9b4e3
@ -2,7 +2,7 @@
|
||||
#
|
||||
# shellcheck disable=SC1090,SC1091,SC1117,SC2016,SC2046,SC2086
|
||||
#
|
||||
# version: 0.0.5
|
||||
# version: 0.0.6
|
||||
#
|
||||
|
||||
if [[ $(id -u) -ne 0 ]]; then
|
||||
@ -69,10 +69,16 @@ apt-get --yes \
|
||||
--option DPkg::Options::="--force-confold" \
|
||||
dist-upgrade
|
||||
|
||||
|
||||
if [ ! -f "/usr/sbin/omv-mkaptidx" ]; then
|
||||
echo "omv-mkaptidx does not exist. Downloading..."
|
||||
wget -O /usr/sbin/omv-mkaptidx https://github.com/openmediavault/openmediavault/raw/master/deb/openmediavault/usr/sbin/omv-mkaptidx
|
||||
chmod +x /usr/sbin/omv-mkaptidx
|
||||
else
|
||||
if ! grep -q 'bin/sh' /usr/sbin/omv-mkaptidx; then
|
||||
rm -f /usr/sbin/omv-mkaptidx
|
||||
dpkg-divert --remove --rename /usr/sbin/omv-mkaptidx
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Rebuild apt index ..."
|
||||
|
||||
Loading…
Reference in New Issue
Block a user