Tarhon-Onu Victor wrote:
> Cam asta ar fi o varianta (sau 2).
>
>
Multumesc de sugestie, dar deocamdata mi se pare un pic overkill. Pina
una alta am rezolvat-o cu un bash script. Cu siguranta ai mai priceputi
in bash il mai pot simplifica:
#!/bin/sh
#
# $1 = network behind the client
# $2 = network address of the ppp server
#
NETWORK=$1
GW=$2
usage() {
echo "usage: check_routes network gateway"
exit 1;
}
addroute() {
PPPS=`ifconfig | grep ppp | awk '{print $1}'`
for I in $PPPS; do
echo $I
IP=`ifconfig $I | grep addr | awk '{print $2}' | awk -F :
'{print $2}'`
echo $IP
if [ "$IP" = "$GW" ]; then
echo "Adding route to $NETWORK via $I"
/sbin/route add -net $NETWORK netmask 255.255.255.0 dev $I
fi
done
}
if [ -z "$NETWORK" ]; then
usage
fi
if [ -z "$GW" ]; then
usage
fi
HAVEROUTE=`route -n | grep $NETWORK`
if [ -z "$HAVEROUTE" ]; then
echo "Route not found"
addroute $NETWORK $GW
fi
---
Detalii despre listele noastre de mail: http://www.lug.ro/