Cosmetic: grep tries to read the file even if it's not there. Change: check_os_is_ubuntu () { grep -iq '^DISTRIB_ID *= *Ubuntu' /etc/lsb-release } to: check_os_is_ubuntu () { [ -s /etc/lsb-release ] && grep -iq '^DISTRIB_ID *= *Ubuntu' /etc/lsb-release }
Cosmetic: grep tries to read the file even if it's not there.
Change:
check_os_is_ubuntu () {
grep -iq '^DISTRIB_ID *= *Ubuntu' /etc/lsb-release
}
to:
check_os_is_ubuntu () {
[ -s /etc/lsb-release ] && grep -iq '^DISTRIB_ID *= *Ubuntu' /etc/lsb-release
}