Something like
- hostname=`hostname -f` + hostname=`hostname -f 2>/dev/null || hostname`
should do it.
Something like
- hostname=`hostname -f`
+ hostname=`hostname -f 2>/dev/null || hostname`
should do it.