From 9f6a204d7383324974af67eb3cc4c93b426b6170 Mon Sep 17 00:00:00 2001 From: Matthias Dienstbier Date: Wed, 22 Jul 2009 21:32:11 +0200 Subject: more intelligent manual network configuration --- src/core/libs/lib-ui-interactive.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 2b53465..acbd50f 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -781,11 +781,13 @@ interactive_runtime_network() { IPADDR=$ANSWER_STRING ask_string "Enter your netmask" "255.255.255.0" || return 1 SUBNET=$ANSWER_STRING - ask_string "Enter your broadcast" "192.168.0.255" || return 1 + ask_string "Enter your broadcast" "$(sed 's/\.[^.]*$/\.255/' <<< $IPADDR)" || return 1 BROADCAST=$ANSWER_STRING - ask_string "Enter your gateway (optional)" "192.168.0.1" 0 || return 1 + ask_string "Enter your gateway (optional)" "$(sed 's/\.[^.]*$/\.1/' <<< $IPADDR)" 0 || return 1 GW=$ANSWER_STRING - ask_string "Enter your DNS server IP" "192.168.0.1" || return 1 + [ -n "$GW" ] && default_dns="$GW" + [ -z "$GW" ] && default_dns="$(sed 's/\.[^.]*$/\.1/' <<< $IPADDR)" + ask_string "Enter your DNS server IP" "$default_dns" || return 1 DNS=$ANSWER_STRING ask_string "Enter your HTTP proxy server, for example:\nhttp://name:port\nhttp://ip:port\nhttp://username:password@ip:port\n\n Leave the field empty if no proxy is needed to install." "" 0 || return 1 PROXY_HTTP=$ANSWER_STRING -- cgit v1.2.3-54-g00ecf