summaryrefslogtreecommitdiff
path: root/setup-alpine.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-11-22 11:42:58 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2022-11-22 11:42:58 +0100
commitc7fa8d0c0bb4a7f047bc0bf5282d20cf754f5703 (patch)
tree7bf968fcb5065b1402ad6bf295590509fcf10c94 /setup-alpine.in
parenteef31dff2eae711c33cabc1a05b2c9df2fa25d01 (diff)
downloadalpine-conf-c7fa8d0c0bb4a7f047bc0bf5282d20cf754f5703.zip
setup-alpine: leave interfaces file unmodified with 'none'
fixes https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10542
Diffstat (limited to 'setup-alpine.in')
-rw-r--r--setup-alpine.in7
1 files changed, 5 insertions, 2 deletions
diff --git a/setup-alpine.in b/setup-alpine.in
index 2308f88..aea9d3f 100644
--- a/setup-alpine.in
+++ b/setup-alpine.in
@@ -158,14 +158,17 @@ fi
[ -z "$SSH_CONNECTION" ] && rst_if=1
if [ -n "$INTERFACESOPTS" ]; then
- printf "$INTERFACESOPTS" | setup-interfaces -i ${rst_if:+-r}
+ if [ "$INTERFACESOPTS" != none ]; then
+ printf "$INTERFACESOPTS" | setup-interfaces -i ${rst_if:+-r}
+ fi
else
setup-interfaces ${quick:+-a} ${rst_if:+-r}
fi
# setup up dns if no dhcp was configured
-grep '^iface.*dhcp' $ROOT/etc/network/interfaces > /dev/null ||\
+if [ -f "$ROOT"/etc/network/interfaces ] && ! grep -q '^iface.*dhcp' "$ROOT"/etc/network/interfaces; then
setup-dns ${DNSOPTS}
+fi
# set root password
if [ -z "$empty_root_password" ]; then