linkinpark
Expert Member
- Joined
- Jun 27, 2005
- Messages
- 1,465
- Reaction score
- 225
the code in a script file gave this:
test: 2: [[: not found
false
test: 2: [[: not found
false
South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
the code in a script file gave this:
test: 2: [[: not found
false
GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
and the second one:
lrwxrwxrwx 1 root root 4 2006-11-03 00:16 /bin/sh -> dash
lol. you can say *phew* again.
it took forever and in the end it was as simple as the wrong shell :/
Thanks for your help dude
To get an updated route list, and assuming you have netcat installed:
echo -e "terminal length 0\nshow ip bgp\nexit" | nc route-server.is.co.za 23 | grep ^* | awk '{print $2}' > routes.txt
- twiga
noir:~# cat /etc/ppp/ip-up
#!/bin/sh
#
# $Id: ip-up,v 1.2 1998/02/10 21:25:34 phil Exp $
#
# This script is run by the pppd after the link is established.
# It uses run-parts to run scripts in /etc/ppp/ip-up.d, so to add routes,
# set IP address, run the mailq etc. you should create script(s) there.
#
# Be aware that other packages may include /etc/ppp/ip-up.d scripts (named
# after that package), so choose local script names with that in mind.
#
# This script is called with the following arguments:
# Arg Name Example
# $1 Interface name ppp0
# $2 The tty ttyS1
# $3 The link speed 38400
# $4 Local IP number 12.34.56.78
# $5 Peer IP number 12.34.56.99
# $6 Optional ``ipparam'' value foo
# The environment is cleared before executing this script
# so the path must be reset
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
export PATH
# These variables are for the use of the scripts run by run-parts
PPP_IFACE="$1"
PPP_TTY="$2"
PPP_SPEED="$3"
PPP_LOCAL="$4"
PPP_REMOTE="$5"
PPP_IPPARAM="$6"
export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
# as an additional convenience, $PPP_TTYNAME is set to the tty name,
# stripped of /dev/ (if present) for easier matching.
PPP_TTYNAME=`/usr/bin/basename "$2"`
export PPP_TTYNAME
# Main Script starts here
#if($1 == "ppp1") { run-parts /etc/ppp/ip-up.d }
#if($1 == "ppp0")
#{
# /sbin/route add -net 196.25.66.50 netmask 255.255.255.255 dev ppp0
#}
case $4 in
196.*)
#route local
for i in `cat /etc/ppp/localroutes.dat`; do
echo ``route add -net `echo $i | sed s/\,/\ netmask\ /g` gw $4 `` ;
``route add -net `echo $i | sed s/\,/\ netmask\ /g` gw $4 `` ;
done
``ip route add 0.0.0.0 dev $1 src $4 table T1``
``ip route add default via $5 table T1``
``ip rule add from $4 table T1``
#run-part /etc/ppp/ip-up.d
;;
41.*)
#international
#route add default gw $1
``ip route add 0.0.0.0 dev $1 src $4 table T2``
``ip route add default via $5 table T2``
``ip rule add from $4 table T2``
run-part /etc/ppp/ip-up.d
;;
esac
# last line
Tracing route to www.yahoo-ht2.akadns.net [209.73.186.238]
over a maximum of 30 hops:
1 <1 ms <1 ms <1 ms noir.restricted.co.za [10.0.0.2]
2 11 ms 11 ms 11 ms dsl-241-128-01.telkomadsl.co.za [41.241.128.1]
3 * * * Request timed out.
4 * * * Request timed out.
5 * * * Request timed out.
6 * * * Request timed out.
7 526 ms 529 ms 532 ms 213.228.221.202
8 543 ms 529 ms 523 ms so-4-1-0.pat2.dce.yahoo.com [216.115.101.146]
9 543 ms 534 ms 528 ms ge-2-1-0-p141.msr1.re1.yahoo.com [216.115.108.19]
10 528 ms 496 ms 533 ms ge-1-30.bas-a2.re3.yahoo.com [66.196.112.37]
11 520 ms 489 ms 499 ms f1.www.vip.re3.yahoo.com [209.73.186.238]
Trace complete.
noir:~# cat /etc/iproute2/rt_tables
#
# reserved values
#
255 local
254 main
253 default
0 unspec
#
# local
#
1 inr.ruhep
101 T1
102 T2