diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2010-12-28 17:56:00 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2010-12-28 17:56:00 +0100 |
commit | 25f7a0471340e8d6c2b37e3c75aa7d0ae209d09d (patch) | |
tree | 8a5c921946125e659df4adf4b2baf733c764d482 /src/core/libs/lib-ui-interactive.sh | |
parent | febffe7a9f6d7dd27eb7e382e11ea9fbda62bb26 (diff) |
cleanup worker_auto_network() / target_configure_network() code
The only thing needed to know before calling target_configure_network()
is whether $RUNTIME_DIR/aif-network-settings exists; if that exists,
network setup has been run sucessfully and all values are known.
It's up to target_configure_network() to source that, which means
worker_auto_network() functions can become simpler.
Also, variable name cleanup: s/S_DHCP/DHCP/
Diffstat (limited to 'src/core/libs/lib-ui-interactive.sh')
-rw-r--r-- | src/core/libs/lib-ui-interactive.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index e7f114b..0b3abb4 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -787,7 +787,7 @@ If any previous configuration you've done until now (like fancy filesystems) req # returns: 1 on failure interactive_runtime_network() { INTERFACE="" - S_DHCP="" + DHCP="" local ifaces ifaces=$(ifconfig -a |grep "Link encap:Ethernet"|sed 's/ \+Link encap:Ethernet \+HWaddr \+/ /g') @@ -810,9 +810,9 @@ interactive_runtime_network() { show_warning "Dhcpcd problem" "DHCP request failed. dhcpcd returned 0 but no ip configured for $INTERFACE" return 1 fi - S_DHCP=1 + DHCP=1 else - S_DHCP=0 + DHCP=0 NETPARAMETERS="" while [ "$NETPARAMETERS" = "" ]; do ask_string "Enter your IP address" "192.168.0.2" || return 1 @@ -859,14 +859,14 @@ interactive_runtime_network() { echo "nameserver $DNS" >/etc/resolv.conf fi echo "INTERFACE=$INTERFACE - S_DHCP=$S_DHCP + DHCP=$DHCP IPADDR=$IPADDR SUBNET=$SUBNET BROADCAST=$BROADCAST GW=$GW DNS=$DNS PROXY_HTTP=$PROXY_HTTP - PROXY_FTP=$PROXY_FTP" > $RUNTIME_DIR/aif-network-settings + PROXY_FTP=$PROXY_FTP" > $RUNTIME_DIR/aif-network-settings || return 1 notify "The network is configured." return 0 } |