diff options
author | Lukas Bestle <mail@lukasbestle.com> | 2021-07-10 13:42:34 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2021-11-16 11:19:28 +0000 |
commit | 39c91c1486c55ce1ee3ec1e646032d04e21406ed (patch) | |
tree | ea311c93a2071e3562c1f08be8ba0635155fde7d /setup-interfaces.in | |
parent | 6864a1896aabf9672e9055314733b427fdafa099 (diff) | |
download | alpine-conf-39c91c1486c55ce1ee3ec1e646032d04e21406ed.zip |
setup-interfaces: New -r flag to restart service
Fixes #10480.
Fixes #10484.
Diffstat (limited to 'setup-interfaces.in')
-rw-r--r-- | setup-interfaces.in | 10 |
1 files changed, 8 insertions, 2 deletions
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 |