summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-03-22 23:09:49 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2012-03-22 23:09:49 +0100
commit62ed7f2b6462fe2e9269cc2aaa84e710990d5c96 (patch)
tree909a45b0b68e5ee20ee7badd413a2a1677be5296
parentc316bc87923cd8a740a5e707a56bdfc7704076d8 (diff)
downloadalpine-conf-62ed7f2b6462fe2e9269cc2aaa84e710990d5c96.tar.bz2
alpine-conf-62ed7f2b6462fe2e9269cc2aaa84e710990d5c96.tar.xz
setup-interfaces: install packages for bonding and/or bridge if needed
-rwxr-xr-xsetup-interfaces.in10
1 files changed, 9 insertions, 1 deletions
diff --git a/setup-interfaces.in b/setup-interfaces.in
index bb2325c..a7fe9e9 100755
--- a/setup-interfaces.in
+++ b/setup-interfaces.in
@@ -3,6 +3,8 @@
PROGRAM=setup-interfaces
PREFIX=
+PKGS=
+
for i in ./libalpine.sh $PREFIX/lib/libalpine.sh; do
[ -e $i ] && . $i && break
done
@@ -354,9 +356,11 @@ prompt_for_interfaces() {
echo "auto $iface" >> interfaces
echo "iface $iface inet $type" >> interfaces
if [ -n "$bridge_ports" ]; then
+ PKGS="$PKGS bridge"
echo -e "\tbridge-ports $bridge_ports" >> interfaces
fi
if [ -n "$bond_slaves" ]; then
+ PKGS="$PKGS bonding"
echo -e "\tbond-slaves $bond_slaves" >> interfaces
fi
case $type in
@@ -394,7 +398,11 @@ prompt_for_interfaces() {
esac
${EDITOR:-vi} interfaces
fi
-
+
+ if [ -n "$PKGS" ]; then
+ apk add -q $PKGS
+ fi
+
mkdir -p $ROOT/etc/network
cp interfaces $ROOT/etc/network/
}