V961 Tree Umbau
git-svn-id: svn://svn.compuextreme.de/Viitor/V961/Viitor_iproute@4266 504e572c-2e33-0410-9681-be2bf7408885
This commit is contained in:
commit
1f5576e44a
96
etc/init.d/adrouting
Normal file
96
etc/init.d/adrouting
Normal file
|
@ -0,0 +1,96 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
#Dieses script nutzt in verbindung mit dem iproute packet die
|
||||
#advanced routing funktionalitaeten des Linux Kernels
|
||||
#Entsprechende funktionalitaet muss in den kernel einkompiliert sein.
|
||||
#
|
||||
#(c) Rainmaker MultiMedia OHG
|
||||
#
|
||||
#$Author$
|
||||
#$Date$
|
||||
#$Revision$
|
||||
#
|
||||
#$Log$
|
||||
#Revision 1.2 2003/04/19 07:47:37 kueller
|
||||
#Restart funktion und defaultverhalten (usage ausgabe) eingebaut
|
||||
#
|
||||
#Revision 1.1.1.1 2002/06/20 15:05:07 hkueller
|
||||
#Start Scripten für advanced kernel routing
|
||||
#
|
||||
#
|
||||
|
||||
source /etc/init.d/functions
|
||||
|
||||
#DEBUG=echo
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
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
|
||||
echo -n "Adding routing for net $NETWORK over device $DEVICE to table $TABLE"
|
||||
$DEBUG ip route add $NETWORK dev $DEVICE table $TABLE
|
||||
evaluate_retval
|
||||
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
|
||||
echo -n "Adding routing rule $ROUTETYPE $ROUTOPT with destination $RULDEST"
|
||||
$DEBUG ip rule add $RULTYPE $RULOPT table $RULDEST
|
||||
evaluate_retval
|
||||
read <&3 RULTYPE RULOPT RULDEST
|
||||
done
|
||||
exec 3>&-
|
||||
rm /tmp/routerule
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
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
|
||||
echo -n "deleting rule $RULTYPE $RULOPT from table $RULDEST"
|
||||
$DEBUG ip rule del $RULTYPE $RULOPT table $RULDEST
|
||||
evaluate_retval
|
||||
read <&3 RULTYPE RULOPT RULDEST
|
||||
done
|
||||
exec 3>&-
|
||||
rm /tmp/routerule
|
||||
fi
|
||||
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
|
||||
echo -n "deleting routeentry for $NETWORK from table $TABLE"
|
||||
$DEBUG ip route del $NETWORK dev $DEVICE table $TABLE
|
||||
evaluate_retval
|
||||
read <&3 NETWORK DEVICE TABLE
|
||||
done
|
||||
exec 3>&-
|
||||
rm /tmp/routetable
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 {start|stop|restart}"
|
||||
;;
|
||||
esac
|
||||
#end /etc/inet.d/network
|
33
init/genpkg
Normal file
33
init/genpkg
Normal file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
#genpkg für iproute
|
||||
#(c) Rainmaker MultiMedia OHG
|
||||
#
|
||||
#$Author$
|
||||
#$Date$
|
||||
#$Revision$
|
||||
#
|
||||
#$Log$
|
||||
#Revision 1.1 2002/06/20 15:05:07 hkueller
|
||||
#Initial revision
|
||||
#
|
||||
#
|
||||
|
||||
WDIR=`pwd`
|
||||
cd etc/init.d
|
||||
for i in *; do
|
||||
if [ -f $i ]; then
|
||||
chmod 755 $i
|
||||
fi
|
||||
done
|
||||
mkdir rc{0,1,2,3,4,5,6}.d
|
||||
for i in 0 1 2 6; do
|
||||
cd rc$i.d
|
||||
ln -s ../adrouting K73adrouting
|
||||
cd ..
|
||||
done
|
||||
for i in 3 4 5; do
|
||||
cd rc$i.d
|
||||
ln -s ../adrouting S14adrouting
|
||||
cd ..
|
||||
done
|
||||
cd $WDIR
|
Loading…
Reference in New Issue
Block a user