#!/bin/sh
#
# $Id: connect.sh,v 1.2 2003/03/16 12:57:06 vince Exp $
#
#Slip connect script for WWWPic2
#Assumes default ip address

#Serial port to start slip link on
SPORT=ttyS0
#Serial port Speed
SSPEED=19200
#Slip device to start
SLIPDEV=sl0
#Slip net
SLIPNET=192.168.2.
#Local IP
LOC_IP=${SLIPNET}1
#Webserver IP
WWWPIC2_IP=${SLIPNET}2
#Ethernet to forward on - define if you want to forward the slip link
#ETHERDEV=eth0

echo "Starting SLIP..."
slattach -d -p slip -s ${SSPEED} ${SPORT} &
sleep 2
ifconfig ${SLIPDEV} ${LOC_IP}
ifconfig ${SLIPDEV} dstaddr ${WWWPIC2_IP}
if [ ${ETHERDEV} != "" ];then
echo "Done. Starting forwarding..."
echo "1" >> /proc/sys/net/ipv4/conf/${ETHERDEV}/forwarding
echo "1" >> /proc/sys/net/ipv4/conf/${ETHERDEV}/proxy_arp
echo "1" >> /proc/sys/net/ipv4/conf/${SLIPDEV}/forwarding
fi
echo "Done"
