Compare commits
No commits in common. "v961" and "v963" have entirely different histories.
38
etc/init/adrouting.conf
Normal file
38
etc/init/adrouting.conf
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
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
|
@ -12,6 +12,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
if [ -d /var/install/sysvinit* ]; then
|
||||||
WDIR=`pwd`
|
WDIR=`pwd`
|
||||||
cd etc/init.d
|
cd etc/init.d
|
||||||
for i in *; do
|
for i in *; do
|
||||||
@ -31,3 +32,4 @@ for i in 3 4 5; do
|
|||||||
cd ..
|
cd ..
|
||||||
done
|
done
|
||||||
cd $WDIR
|
cd $WDIR
|
||||||
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user