-reply="$(echo "GET preseed/early_command" | chroot /root debconf-communicate -fnoninteractive casper)"
-if [ "${reply#0 }" != "$reply" ]; then
- reply="${reply#0 }"
- sh -c "$reply"
+if db_get preseed/early_command && [ "$RET" ]
+then
+ EARLY="$RET"
+ if db_get preseed/allow-network && [ "$RET" = true ]; then
+ start_network
+ fi
+
+ DEBIAN_HAS_FRONTEND= DEBCONF_REDIR= \
+ DEBIAN_FRONTEND=noninteractive \
+ sh -c "$EARLY"