summaryrefslogtreecommitdiff
path: root/setup-interfaces.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-03-22 22:53:39 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2012-03-22 22:53:39 +0100
commitc316bc87923cd8a740a5e707a56bdfc7704076d8 (patch)
treef690132de6a51c22cff5a289c5a6044eba995dc7 /setup-interfaces.in
parent3b0ca46fbbcf5bbbb79abbc16856dfc7bd12dc76 (diff)
downloadalpine-conf-c316bc87923cd8a740a5e707a56bdfc7704076d8.zip
setup-interfaces: allow 'manual' interfaces without ip addr
Useful for bonding and bridges
Diffstat (limited to 'setup-interfaces.in')
-rwxr-xr-xsetup-interfaces.in11
1 files changed, 9 insertions, 2 deletions
diff --git a/setup-interfaces.in b/setup-interfaces.in
index 042475e..bb2325c 100755
--- a/setup-interfaces.in
+++ b/setup-interfaces.in
@@ -141,16 +141,19 @@ config_iface() {
while ! ipcalc -s -m $address >/dev/null 2>&1; do
address=`get_default_addr $iface`
[ -z "$address" ] && address="dhcp"
- ask "Ip address for $iface? (or 'dhcp' or '?')" $address
+ ask "Ip address for $iface? (or 'dhcp', 'none', '?')" $address
address=$resp
case "$resp" in
'?') ipaddr_help;;
"abort") return;;
"dhcp")
- HAS_DHCP=yes
echo "type=dhcp" >> $conf
unconfigured_del $iface
return ;;
+ "none")
+ echo "type=manual" >> $conf
+ unconfigured_del $iface
+ return;;
br[0-9]*|bridge[0-9]*)
case "$iface" in
# we dont allow bridge bridges
@@ -357,6 +360,10 @@ prompt_for_interfaces() {
echo -e "\tbond-slaves $bond_slaves" >> interfaces
fi
case $type in
+ manual)
+ echo -e "\tup ip link set \$IFACE up" >> interfaces
+ echo -e "\tdown ip link set \$IFACE down" >> interfaces
+ ;;
dhcp)
[ -n "$hostname" ] \
&& echo -e "\thostname $hostname" >> interfaces