-bailout() {
- rm -f $TMP
- exit 1
-}
-trap bailout 1 2 3 15
-
-# running inside grml2hd? Don't warn because of hostname + X
-[ -n "$GRML2HD" ] || MSG='\n\nNotice: setting a different hostname while running X is *not* recommend!'
-
-HOSTNAME="$(dialog --stdout --title "${PN}" --extra-button --extra-label "Propose hostname" \
---inputbox "Set hostname (/etc/hostname, /etc/hosts and /etc/postfix/main.cf will be adjusted)\
-\n\nTip: press 'Propose hostname' for another proposal${MSG}" 14 70 $HOSTNAME)"
-retval=$?
+if [ -z "$NONINTERACTIVE" ] ; then
+ HOSTNAME="$(dialog --stdout --title "${PN}" --extra-button --extra-label "Propose hostname" \
+ --inputbox "Set hostname (/etc/hostname, /etc/hosts and /etc/postfix/main.cf will be adjusted)\
+\n\nTip: press 'Propose hostname' for another proposal" 14 70 $HOSTNAME)"
+ retval=$?
+else
+ retval=0
+fi