Programmer
December 29th, 2004, 10:56 PM
Hello all :-)
As you know, the cable internet in Israel is a little bit more complicated so i have written a script that do the job for me :-)
Here is the script:
------------------------------------------------------------------------------------------------
#! /bin/tcsh
#
# This script was written by Alexander Sirotin
# email: sirotin@gmail.com
#
# The path to pptp and route commands
set PPTP = "/root/bin/pptp"
set ROUTE = "/sbin/route"
# Some settings
set HOST = "192.117.122.13" # pns3.actcom.net.il
set USER = "sprog@CActcom"
set IFACE = "eth0"
# Configure the firewall options
/root/bin/net-firewall.sh
# Configure the internet sharing
/root/bin/net-share.sh
# Get the cables gateway
set CABLEGW = `ifconfig $IFACE | grep "inet addr:" | cut -c21-36 | cut -d" " -f1`
# Configure the routing table
$ROUTE del -net 0.0.0
$ROUTE add $HOST gw $CABLEGW
# Open pptp tunnel
$PPTP $HOST debug user $USER defaultroute noauth
# Save DNS information
cp -f /root/resolv.conf /etc/
# Wait until we'll have a public ip address
sleep 7
# Get the ip address and print it
set IP = `ifconfig ppp0 | grep "inet addr:" | cut -c21-36` | cut -d" " -f1`
echo "Connection Established. Your IP is $IP"
------------------------------------------------------------------------------------------------
My question is how can i convert this script from tcsh to bash (i don't know bash) ?
Thanks.
As you know, the cable internet in Israel is a little bit more complicated so i have written a script that do the job for me :-)
Here is the script:
------------------------------------------------------------------------------------------------
#! /bin/tcsh
#
# This script was written by Alexander Sirotin
# email: sirotin@gmail.com
#
# The path to pptp and route commands
set PPTP = "/root/bin/pptp"
set ROUTE = "/sbin/route"
# Some settings
set HOST = "192.117.122.13" # pns3.actcom.net.il
set USER = "sprog@CActcom"
set IFACE = "eth0"
# Configure the firewall options
/root/bin/net-firewall.sh
# Configure the internet sharing
/root/bin/net-share.sh
# Get the cables gateway
set CABLEGW = `ifconfig $IFACE | grep "inet addr:" | cut -c21-36 | cut -d" " -f1`
# Configure the routing table
$ROUTE del -net 0.0.0
$ROUTE add $HOST gw $CABLEGW
# Open pptp tunnel
$PPTP $HOST debug user $USER defaultroute noauth
# Save DNS information
cp -f /root/resolv.conf /etc/
# Wait until we'll have a public ip address
sleep 7
# Get the ip address and print it
set IP = `ifconfig ppp0 | grep "inet addr:" | cut -c21-36` | cut -d" " -f1`
echo "Connection Established. Your IP is $IP"
------------------------------------------------------------------------------------------------
My question is how can i convert this script from tcsh to bash (i don't know bash) ?
Thanks.