Viitor_iproute/etc/init/adrouting.conf
kueller bf2c977d83 Neue Version V963
git-svn-id: svn://svn.compuextreme.de/Viitor/V963/Viitor_iproute@5933 504e572c-2e33-0410-9681-be2bf7408885
2011-01-03 10:48:06 +00:00

39 lines
1.1 KiB
Plaintext

description "Setup Routing depending on several config files"
author "Harald Kueller <harald.kueller@compuextreme.de>"
version 1.0
emits none special
start on stopped routing
console output
script
source /etc/init/functions
if [ -f /etc/sysconfig/net/routetable ]; then
sed -e "/^#/d" /etc/sysconfig/net/routetable | \
sed -e "/^ *$/d" >/tmp/routetable
exec 3</tmp/routetable
read <&3 NETWORK DEVICE TABLE
while [ "$NETWORK" ]; do
$DEBUG ip route add $NETWORK dev $DEVICE table $TABLE
status_message "Added routing for net $NETWORK over device $DEVICE to table $TABLE"
read <&3 NETWORK DEVICE TABLE
done
exec 3>&-
rm /tmp/routetable
fi
if [ -f /etc/sysconfig/net/routerule ]; then
sed -e "/^#/d" /etc/sysconfig/net/routerule | \
sed -e "/^ *$/d" >/tmp/routerule
exec 3</tmp/routerule
read <&3 RULTYPE RULOPT RULDEST
while [ "$RULTYPE" ]; do
$DEBUG ip rule add $RULTYPE $RULOPT table $RULDEST
status_message "Adding routing rule $ROUTETYPE $ROUTOPT whith destination $RULDEST"
read <&3 RULTYPE RULOPT RULDEST
done
exec 3>&-
rm /tmp/routerule
fi
end script