Friday, November 30, 2007

Computer stuff

I just appropriated a new (to me) computer from my job. They love to just "dispose" of their older computers so if it's worth it, I take them home and put them to good use =]

I "appropriated" a Dell server, 2.8GHZ HT machine with 2 40 gig HDs and a Gig of RAM. I thought this would be a good time to replace my Linux server which is a 1.2Ghz PIII. This server acts as a firewall/gateway for the other computers on my network. It's also my webserver http://gypsy.sytes.net/ which isn't always up, but I'll get into that later.

I have DSL at home (6M/768K) which isn't bad, it's pretty quick normally, with a dynamic IP# and I use a Dynamic nameserver to get my gypsy.sytes.net address. I use Roaring Penguin's PPPOE software to connect, which works great, but my problem lies when my IP# changes and I lose my name on the machine. It's difficult to get it back again, I've written scripts to try to bring the name back to the current IP# but it always wants to hang on to the old IP. I'm hoping with this new modem, and a new server, I might be able to get this to work right. If I'm still having no luck, I'll call the TELCO and get a Static IP ($5/mo extra) and use that instead. Here is one script I use

#!/bin/sh

RMM="/sbin/rmmod"
MDP="/sbin/modprobe"
START="/usr/sbin/adsl-start"
STOP="/usr/sbin/adsl-stop"

EXTIF="ppp0"
EXTIP="`/sbin/ifconfig $EXTIF | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'`"
HOSTIP="`/usr/bin/host gypsy.sytes.net | awk '{print $4}'`"
#TIME="`/bin/date '+%m-%d-%Y %w %T'`"


if [ "$EXTIP" != "$HOSTIP" ]; then

/usr/sbin/adsl-stop
NPID="`ps aux | grep noip2 | grep nobody | awk '{ print $2 }'`"
/usr/local/bin/noip2 -K "$NPID"

/usr/sbin/adsl-start
/etc/rc.d/rc.firewall
/usr/local/bin/noip2
/usr/local/bin/dynubasic.sh
fi
exit 0


Now this bash script gets the IP#s of my ACTUAL IP and the one that's attached to gypsy.sytes.net and compares them, if they're different, it tries to get it attached to the new one. This script isn't working right. If I get this to work, I'll post what I did.

No comments: