jablonka.czprosek.czf

sedlo

Subversion Repositories:
[/] [trunk/] [sedlo] - Diff between revs 5 and 6

Show entire file Ignore whitespace

Rev 5 Rev 6
Line 43... Line 43...
echo "$sl_rttab not found" echo "$sl_rttab not found"
exit 1 exit 1
fi fi
   
sl_murlcfg=`cat $sl_sedlocnf | grep "^mcnf" | uniq | awk '{print $2}'` sl_murlcfg=`cat $sl_sedlocnf | grep "^mcnf" | uniq | awk '{print $2}'`
  sl_local_conf_myigw=`awk '/^myigw/ { print $2 "*" $3 "*" $4 }' < $sl_sedlocnf`
   
###################################################################### ######################################################################
s_flqq() s_flqq()
{ {
if [ $scm_info -gt 0 ]; then echo "Managing rules" ; fi if [ $scm_info -gt 0 ]; then echo "Managing rules" ; fi
Line 82... Line 83...
   
if [ $scm_info -gt 0 ]; then echo "Creating rules" ; fi if [ $scm_info -gt 0 ]; then echo "Creating rules" ; fi
   
sl_ips=`$sl_catcmd $sl_sedlocache/$sl_nmcnf | $sl_grepcmd "^ip" | $sl_awkcmd '{print $2"*"$4"*"$5"*"$6}'` sl_ips=`$sl_catcmd $sl_sedlocache/$sl_nmcnf | $sl_grepcmd "^ip" | $sl_awkcmd '{print $2"*"$4"*"$5"*"$6}'`
   
for sl_ip in $sl_ips this_router="THIS_ROUTER*$sl_local_conf_myigw"
   
  # $this_router format: THIS_ROUTER*igw1name*igw2name*igw3name
   
  for sl_ip in $this_router $sl_ips
do do
sl_ipn=`echo $sl_ip | $sl_awkcmd -F '*' '{print $1}'` sl_ipn=`echo $sl_ip | $sl_awkcmd -F '*' '{print $1}'`
sl_ipgws=`echo $sl_ip | $sl_awkcmd -F '*' '{print $2,$3,$4}'` sl_ipgws=`echo $sl_ip | $sl_awkcmd -F '*' '{print $2,$3,$4}'`
sl_ok="no" sl_ok="no"
for sl_ipgw in $sl_ipgws for sl_ipgw in $sl_ipgws
do do
sl_tbl=`$sl_ipcmd ro ls ta $sl_ipgw` sl_tbl=`$sl_ipcmd ro ls ta $sl_ipgw`
if [ "$sl_tbl x" != " x" ] && [ "$sl_ok" = "no" ] if [ "$sl_tbl x" != " x" ] && [ "$sl_ok" = "no" ]
then then
if [ $scm_info -gt 1 ]; then echo "Creating new rules to send $sl_ipn to table $sl_ipgw" ; fi if [ $scm_info -gt 1 ]; then echo "Creating new rules to send $sl_ipn to table $sl_ipgw" ; fi
$sl_ipcmd ru add from $sl_ipn lookup $sl_ipgw case "$sl_ipn" in
  "THIS_ROUTER")
  $sl_ipcmd ru add iif lo table $sl_ipgw ;;
  *)
  $sl_ipcmd ru add from $sl_ipn table $sl_ipgw ;;
  esac
sl_ok="yes" sl_ok="yes"
else else
if [ "$sl_ok" = "no" ] if [ "$sl_ok" = "no" ]
then then
if [ $scm_info -gt 1 ]; then echo "For $sl_ipn table $sl_ipgw not used because it is empty" ; fi if [ $scm_info -gt 1 ]; then echo "For $sl_ipn table $sl_ipgw not used because it is empty" ; fi

Powered by WebSVN 2.2.1