Results 1 to 1 of 1
[How-to] D-Link DSL-2640S renew IP address, 1-click
This is a discussion on [How-to] D-Link DSL-2640S renew IP address, 1-click within the Sky Router forums, part of the Sky Broadband help category; Downloading from sites like rapidshare / hotfile / megaupload can be frustrating if you keep getting "download limit exceed, wait ...
- 05-01-11, 12:40 PM #1
[How-to] D-Link DSL-2640S renew IP address, 1-click
Downloading from sites like rapidshare / hotfile / megaupload can be frustrating if you keep getting "download limit exceed, wait X hours" messages.
Using the router's web interface to disconnect and reconnect will renew the IP address and get around the limits but it's a lot of clicking!
So I decided to make a windows .bat script to renew the address with a single click.
I am using cURL to interact with the router web-interface from the command line. Download the windows version of cURL from http://www.paehl.com/open_source/?do...curl_721_3.zip
Extract curl.exe and the 2 .bat files from the attachment below into the same folder.
The 2 .bat files contain the following commands:
1. session.bat
Code:@echo off %~dp0curl.exe http://192.168.0.1/constatus.html -s -u "admin:sky" | find "var sessionKey"
2. renew.bat
Code:FOR /F "tokens=2 delims='" %%G IN ('"%~dp0session.bat"') DO set session=%%G %~dp0curl.exe "http://192.168.0.1/wanpppconnect.cmd?action=stop&sessionKey=%session%" choice /T 5 /N /D y FOR /F "tokens=2 delims='" %%G IN ('"%~dp0session.bat"') DO set session=%%G %~dp0curl.exe "http://192.168.0.1/wanpppconnect.cmd?action=start&sessionKey=%session%"
Linux version
renew.sh
Code:#!/bin/bash t=`curl http://192.168.0.1/constatus.html -s -u "admin:sky" | grep "var sessionKey" | cut -d"'" -f2` curl "http://192.168.0.1/wanpppconnect.cmd?action=stop&sessionKey=$t" sleep 5 t=`curl http://192.168.0.1/constatus.html -s -u "admin:sky" | grep "var sessionKey" | cut -d"'" -f2` curl "http://192.168.0.1/wanpppconnect.cmd?action=start&sessionKey=$t"
Last edited by t-bon3; 18-01-11 at 11:58 AM. Reason: added Linux version
Advertisement