martomi / chiadog

A watch dog providing a peace in mind that your Chia farm is running smoothly 24/7.
MIT License
457 stars 120 forks source link

Fix install script package checks #193

Closed bradclow closed 3 years ago

bradclow commented 3 years ago

Removes the return statement that always causes the packages check to fail.

Recognises removed packages should be installed again.

bradclow commented 3 years ago

The current install.sh script always does the apt-get update and install, even if the packages are already installed. It is caused by the incorrect return statement in function package_installed. The redirect to /dev/null masks the error.

Also found that dpkg -l had a successful exit code even after a package has been removed. dpkg -s handled the situation better.

Tested on Ubuntu 20.04.2 LTS.

Also added the hashbang at the top for good form.