• Welcome to Hurricane Electric's IPv6 Tunnel Broker Forums.

regarding the updated web interface

Started by crobertp, July 28, 2008, 09:25:49 AM

Previous topic - Next topic

blusk

Just in case there's someone out there that has trouble with the script as provided (I didn't have curl installed by default), here's a BASH script I whipped off in a few hours of work this afternoon instead:

http://lusk.dyndns.org/tech/updater.txt

This one includes a method of automatically pulling the current public IP address from a specific interface.  Initial testing indicates it's solid, and I'm leaving the troubleshooting code in place (although commented out) for now.  Running it as a crontab job should work fine.

Comments and improvements are appreciated.  More features might be needed, though, if you have more specific needs.

Brian

FloSoft

Hi,
I made a Debian/Ubuntu script for ip-up.d:


/etc/ppp/ip-up.d/dnsupdate

#!/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin

# If pppconfig has been removed we are not supposed to do anything.
test -f /usr/sbin/pppconfig || exit 0

# If we don't have a provider we have nothing to do.
test -z "$CALL_FILE" && exit 0

# Strip options.
PROVIDER=`echo "$CALL_FILE" | cut -d' ' -f1`
ACTIVE_PROVIDER=""

HEIP=$PPP_LOCAL
HETUNNELID=
HEUSER=
HEPASS=
HELOG="/tmp/he-net.log"

HESITEURL="https://ipv4.tunnelbroker.net/ipv4_end.php?ipv4b=${HEIP}&pass=${HEPASS}&user_id=${HEUSER}&tunnel_id=${HETUNNELID}"

CURL=/usr/bin/curl
CURLOPT="-k -# -#"

if [ -f /etc/default/dnsupdate ] ; then
. /etc/default/dnsupdate
fi

test -z "$ACTIVE_PROVIDER" && exit 0
test ! "$PROVIDER" = "$ACTIVE_PROVIDER" && exit 0

test -z "$HETUNNELID" && exit 0
test -z "$HEUSER" && exit 0
test -z "$HEPASS" && exit 0

echo "$(date): ${CURL} ${CURLOPT} ${HESITEURL}:" >> ${HELOG}
echo >> ${HELOG}
${CURL} ${CURLOPT} ${HESITEURL} >> ${HELOG}
echo >> ${HELOG}


/etc/default/dnsupdate

ACTIVE_PROVIDER=dsl-provider         # your dial-up ppp "provider" (the name you use for "pon" "poff")
HETUNNELID=12345                     # put here your numeric tunnel id
HEUSER=md5-user-id-from-main-page    # put here your md5-user-id
HEPASS=md5-hash-of-password          # put here your md5-hashed password (you can use echo -n "password" | md5 on your console, but you need sleuthkit)


of course you can use "wget" instead of curl ($CURL), but you have to change the command-line options ($CURLOPT) too, so an invalid ssl-cert will be accepted (thank you tunnelbroker.net for having an invalid ssl-cert)

grinsepilz

Suggestion: Why don't give back the public-ipv4, at least when ipv4b=AUTO is used?