Checking for required packages is returning text instead of a number and that fails the if command.
Following change to grep and count number of "ok"s in the output makes the check working:
_required_packages="coreutils dosfstools mount parted wget util-linux e2fsprogs"
if [ "$(dpkg-query -W -f='${Status}\n' $_required_packages | grep -c 'ok' )" -ne 7 ]; then
Downside of this approach is that it hard-codes number of packages in the if condition.
This issue exists in the generated script in two places, on line 73 and 131.
Checking for required packages is returning text instead of a number and that fails the
if
command. Following change to grep and count number of "ok"s in the output makes the check working:Downside of this approach is that it hard-codes number of packages in the
if
condition. This issue exists in the generated script in two places, on line 73 and 131.