diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2021-01-08 12:33:37 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2021-01-08 12:39:00 +0100 |
commit | 5c113e7283d9057f9c317cc828291e52669d38cd (patch) | |
tree | c9b435db5135a87a79ba8426516941041bd90769 /setup-interfaces.in | |
parent | 08c1223de548d0cbf584f02be58e1c81a683e27d (diff) | |
download | alpine-conf-5c113e7283d9057f9c317cc828291e52669d38cd.zip |
setup-interfaces: use ask_yesno
Diffstat (limited to 'setup-interfaces.in')
-rw-r--r-- | setup-interfaces.in | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/setup-interfaces.in b/setup-interfaces.in index 0b5f2c9..bb36212 100644 --- a/setup-interfaces.in +++ b/setup-interfaces.in @@ -174,17 +174,10 @@ config_iface() { local address= netmask= gateway= bridge_ports= local bridge local conf=$prefix$iface.conf - local answer= - while [ -n "$ask_bridge" ] && ! is_bridge $iface; do - ask "Do you want to bridge the interface $iface?" yes - case "$resp" in - yes|y) resp=yes; break;; - no|n) break;; - esac - done + if [ -n "$ask_bridge" ] && ! is_bridge $iface \ + && ask_yesno "Do you want to bridge the interface $iface? (y/n)" y; then - if [ "$resp" = "yes" ]; then bridge="br$(echo $iface | sed 's/[^0-9]//g')" ask "Name of the bridge you want add $iface to:" $bridge bridge_add_port $resp $iface @@ -532,16 +525,7 @@ prompt_for_interfaces() { echo "" >> interfaces done - while [ "$answer" != "yes" ] && [ "$answer" != "no" ] ; do - ask "Do you want to do any manual network configuration?" no - case $resp in - y) answer=yes;; - n) answer=no;; - *) answer=$resp;; - esac - done - - if yesno "$answer"; then + if ask_yesno "Do you want to do any manual network configuration? (y/n)" n; then case "$EDITOR" in nano) apk add nano;; vim) apk add vim;; |