summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rwxr-xr-xshare/customize-ifupdown.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/share/customize-ifupdown.sh b/share/customize-ifupdown.sh
new file mode 100755
index 0000000..c556d43
--- /dev/null
+++ b/share/customize-ifupdown.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Copyright 2023 Helmut Grohne <helmut@subdivi.de>
+# SPDX-License-Identifier: MIT
+#
+# This is a mmdebstrap customize hook that configures ifupdown for dhcp.
+# It expects ifupdown and isc-dhcp-client to be installed.
+
+set -eu
+
+TARGET=$1
+
+IFFILE=interfaces
+test -d "$TARGET/etc/network/interfaces.d" && IFFILE="interfaces.d/eth"
+
+cat >"$TARGET/etc/network/$IFFILE" <<EOF
+auto /enp*=eth
+iface eth inet dhcp
+EOF