From e2c6c45b65f91ce844975b2577f628d747a0416c Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 23 Mar 2012 11:02:55 +0100 Subject: setup-interfaces: improve help texts Tanks to nangel --- setup-interfaces.in | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'setup-interfaces.in') diff --git a/setup-interfaces.in b/setup-interfaces.in index bf524b7..a99cc30 100755 --- a/setup-interfaces.in +++ b/setup-interfaces.in @@ -79,13 +79,16 @@ get_default_gateway() { ipaddr_help() { cat <<__EOF__ -For static ip: -Enter the ip address in the format x.x.x.x +Select the ip address for this interface. -For dhcp: -Enter 'dhcp' +dhcp Dynamic/automatic ip via DHCP +none Do not add any address +n.n.n.n (ex: 192.168.0.1) Static ip +n.n.n.n/m (ex: 192.168.0.1/24) Static ip with mask +br[0-9]+ (ex: br0) Add this interface to a bridge +bridge[0-9] (ex: bridge0) Add this interface to a bridge -To add this interface to a bridge enter the bridge name (eg 'br0' or 'bridge0') +You will be prompted for netmask if not specified with the address. __EOF__ } @@ -336,6 +339,24 @@ __EOF__ exit 1 } +iface_help() { + cat <<__EOF__ + +Select the interface you wish to configure. + +For advanced configurations, you can also enter: +br[0-9]+ (ex: br0) bridge interface +bridge[0-9]+ (ex: bridge0) bridge interface +bond[0-9]+ (ex: bond32) bonded interface +vlan[0-9]+ (ex: vlan371) vlan interface +eth?.[0-9]+ (ex: eth0.371) vlan interface +bond?.[0.9]+ (ex: bond0.371) vlan interface + +You will be asked which physical interface(s) to +be used for advanced configurations. + +__EOF__ +} prompt_for_interfaces() { init_tmpdir TMP @@ -345,12 +366,14 @@ prompt_for_interfaces() { index=1 while ! unconfigured_all_done; do echo "Available interfaces are: $(unconfigured_list)." - ask "Which one do you want to initialize? (or 'done')" \ + echo "Enter '?' for help on bridges, bonding and vlans." + ask "Which one do you want to initialize? (or '?' or 'done')" \ $(unconfigured_get_first) iface=$resp case "$iface" in "done") break;; + '?') iface_help; continue;; br[0-9]*|bridge[0-9]*|virbr[0-9]*) config_bridge $iface || continue;; bond[0-9]*) -- cgit v1.2.3