the wrong code is calling "which update-initramfs" outside of if because then the set -e catch an error and there is no way the test on $? can work correct code is: if which update-initramfs > /dev/null; then update-initramfs -u fi -- eric