summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Dienstbier <mdienstbier@googlemail.com>2009-07-22 21:32:11 +0200
committerDieter Plaetinck <dieter@plaetinck.be>2009-07-22 21:32:11 +0200
commit9f6a204d7383324974af67eb3cc4c93b426b6170 (patch)
treee017405d2c2012baf78df27f0d5f0e93c75e5df3 /src
parent5aa94f1476197dbb5bd327cfbd506bf3de1182af (diff)
more intelligent manual network configuration
Diffstat (limited to 'src')
-rw-r--r--src/core/libs/lib-ui-interactive.sh8
1 files changed, 5 insertions, 3 deletions
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