- # notice: 'fai dirinstall' does not seem to exit appropriate ->
- if grep -q 'dpkg: error processing' /var/log/fai/dirinstall/$HOSTNAME/software.log || \
- grep -q 'FAILED with exit code' /var/log/fai/dirinstall/$HOSTNAME/shell.log ; then
+
+ # notice: 'fai dirinstall' does not seem to exit appropriate, so:
+ ERROR=''
+ [ -r "/var/log/fai/dirinstall/$HOSTNAME/software.log" ] &&
+ grep -q 'dpkg: error processing' /var/log/fai/dirinstall/$HOSTNAME/software.log && ERROR=1
+
+ [ -r "/var/log/fai/dirinstall/$HOSTNAME/shell.log" ] &&
+ grep -q 'FAILED with exit code' /var/log/fai/dirinstall/$HOSTNAME/shell.log && ERROR=2
+
+ if [ -n "$ERROR" ] ; then