diff options
-rw-r--r-- | setup-alpine.in | 6 | ||||
-rw-r--r-- | setup-interfaces.in | 10 |
2 files changed, 10 insertions, 6 deletions
diff --git a/setup-alpine.in b/setup-alpine.in index 392290b..4ffae48 100644 --- a/setup-alpine.in +++ b/setup-alpine.in @@ -128,12 +128,10 @@ if [ "$rc_sys" != LXC ]; then fi if [ -n "$INTERFACESOPTS" ]; then - printf "$INTERFACESOPTS" | $PREFIX/sbin/setup-interfaces -i + printf "$INTERFACESOPTS" | $PREFIX/sbin/setup-interfaces -ir else - $PREFIX/sbin/setup-interfaces ${quick:+-a} + $PREFIX/sbin/setup-interfaces ${quick:+-a} -r fi -# start the networking -/etc/init.d/networking --quiet start >/dev/null # setup up dns if no dhcp was configured grep '^iface.*dhcp' $ROOT/etc/network/interfaces > /dev/null ||\ diff --git a/setup-interfaces.in b/setup-interfaces.in index bb36212..e7a5019 100644 --- a/setup-interfaces.in +++ b/setup-interfaces.in @@ -409,7 +409,7 @@ config_vlan() { usage() { cat <<-__EOF__ - usage: setup-interfaces [-bhi] + usage: setup-interfaces [-bhir] Setup network interfaces @@ -417,6 +417,7 @@ usage() { -b Ask for bridging of interfaces -h Show this help -i Read new contents of ${ROOT}etc/network/interfaces from stdin + -r Restart the networking service after the setup __EOF__ exit 1 } @@ -565,13 +566,14 @@ auto_setup() { ask_bridge= is_xen_dom0 && ask_bridge=1 -while getopts "abhip:" opt; do +while getopts "abhip:r" opt; do case $opt in a) auto=1;; b) ask_bridge=1;; h) usage;; i) STDINPUT=1;; p) ROOT=$OPTARG;; + r) restart=1;; esac done @@ -583,3 +585,7 @@ elif [ -n "$auto" ]; then else prompt_for_interfaces fi + +if [ -n "$restart" ]; then + /etc/init.d/networking --quiet restart >/dev/null +fi |