A
aze
keine ahnung. gibts einen shellbefehl, der das fenster schließt und verschwinden läßt?
--max
ja
Code:
$ exit
Folgen Sie dem Video unten, um zu sehen, wie Sie unsere Website als Icon auf Ihrem Homescreen erstellen.
Anmerkung: This feature may not be available in some browsers.
keine ahnung. gibts einen shellbefehl, der das fenster schließt und verschwinden läßt?
--max
$ exit
$ curl "http://fritz.box:49000/upnp/control/WANIPConn1" -H "Content-Type: text/xml; charset="utf-8"" -H "SoapAction: urn:schemas-upnp-org:service:WANIPConnection:1#ForceTermination" -d ""
<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>502</errorCode>
<errorDescription>XML error</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
curl "http://fritz.box:49000/upnp/control/WANIPConn1" -H "Content-Type: text/xml; charset="utf-8"" -H "SoapAction:urn:schemas-upnp-org:service:WANIPConnection:1#ForceTermination" -d "<?xml version='1.0' encoding='utf-8'?> <s:Envelope s:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'> <s:Body> <u:ForceTermination xmlns:u='urn:schemas-upnp-org:service:WANIPConnection:1' /> </s:Body> </s:Envelope>"
#!/usr/bin/php -q
<?php
// Config
$conf = array(
"ip" => "fritz.box", // or 192.168.178.1
"password" => "", // use --password=SECRET
"sleeptime" => 30, // time to wait in seconds
"verbose" => false // verbose mode
);
/*
***
*
* FritzBox-IP-Reset.php
*
* Version 0.1 - Aug 28, 2007
*
* Copyrigth (c) 2007 Matthias Mueller <matthias@ixplosive.de>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
***
*/
/*
this script is based on a perl script which is available here:
http://www.wehavemorefun.de/fritzbox/index.php/Hilfsprogramme_/_Tip \
ps_%26_Tricks#Internet:_Trennen_und_sofortige_Neueinwahl_.28wg._IP_o..C \
3.A4._-_Curl_oder_Perl.29
(sorry, url is very long...)
tested on
- Mac OS X 10.4.10 (Intel) with built-in
PHP 4.4.7 (cli) (built: Jul 10 2007 10:54:32) and
FRITZ!Box Fon WLAN 7170 (UI), Firmware-Version 29.04.37
(Aug 28, 2007)
how to install:
open Terminal.app
$ cd ~
$ ls Fritz*
FritzBox-IP-Reset.php
$ sudo cp FritzBox-IP-Reset.php /usr/bin/ipreset
$ sudo chmod +x /usr/bin/ipreset
usage:
open Terminal.app
$ ipreset --help
*/
/* Do not edit if you don't know what you are doing! */
$version = "Fritz!Box IP Reset 0.1\n";
$help = $version.
"Usage: $argv[0] [options]\n".
" --password=PASSWORD Fritz!Box password\n".
" --verbose verbose mode on\n".
" -h, --help display this help and exit\n".
" -v, --version output version information and exit\n";
function println($str) {
echo $str."\n";
}
function getpw() {
echo "Fritz!Box Password: ";
if (function_exists("ncurses_noecho"))
ncurses_noecho();
$password = trim(fgets(STDIN));
if (function_exists("ncurses_echo"))
ncurses_echo();
return $password;
}
function getip() {
$content = file_get_contents("http://ip-adress.com/");
$pattern = '/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/';
preg_match($pattern, $content, $matches);
return array_pop($matches);
}
function request($host, $path, $referer, $vars, $port = 80, $timeout = 10) {
global $conf;
$fp = @fsockopen($host, $port, $errno, $errstr, $timeout);
if (!$fp) {
println("error");
println("$errstr ($errno)");
} else {
foreach ($vars as $key => $value)
$data .= $key."=".$value."&";
$data = substr($data, 0, -1);
if ($conf['verbose']) println("> connection status: connection open");
fwrite($fp, "POST $path HTTP/1.1\n");
fwrite($fp, "Referer: $referer\n");
fwrite($fp, "Content-type: application/x-www-form-urlencoded\n");
fwrite($fp, "Content-length: ".strlen($data)."\n");
fwrite($fp, "Connection: close\n\n");
fwrite($fp, $data);
if ($conf['verbose']) println("> connection status: data sent");
while (!feof($fp))
$result .= fgets($fp, 128);
if ($conf['verbose']) println("> connection status: response read");
fclose($fp);
return $result;
}
}
function wait() {
global $conf;
if ($conf['verbose']) println("> sleep ".$conf['sleeptime']." sec");
print("> please wait ");
for ($i=0; $i<$conf['sleeptime']; $i++) {
sleep(1);
print(".");
}
print(" done!\n");
}
function ipreset($password) {
global $conf;
// needed vars for http request
$referer = "fritz.box/cgi-bin/webcm?getpage=../html/index_inhalt.html";
$host = "fritz.box";
$path = "/cgi-bin/webcm";
// connect to Fritz!Box
$vars = array(
"getpage" => "../html/de/menus/menu2.html",
"errorpage" => "../html/index.html",
"var:lang" => "de",
"var:pagename" => "home",
"var:menu" => "home",
"login:command/password" => $password
);
if ($conf['verbose']) println("> connecting to box");
$result = request($host, $path, $referer, $vars);
if (preg_match('/Kennwort ist ung/iU', $result)) {
if ($conf['verbose']) println("> box response: password false");
fwrite(STDERR, "> ERROR: Wrong Password!\n");
$password = getpw();
ipreset($password);
} else {
if ($conf['verbose']) println("> box response: password true");
}
// Set PPPoE mode to on demand
$vars = array(
"connection0:pppoe:settings/idle" => "5",
"connection0:pppoe:settings/mode" => "on_demand"
);
if ($conf['verbose']) println("> setting pppoe mode to on demand");
$result = request($host, $path, $referer, $vars);
// Set PPPoE mode to lcp
$vars = array(
"connection0:pppoe:settings/idle" => "0",
"connection0:pppoe:settings/mode" => "lcp"
);
if ($conf['verbose']) println("> setting pppoe mode to lcp");
$result = request($host, $path, $referer, $vars);
// Status
println("> reconnect in progress");
// Wait for reconnect
wait();
}
if ($argv[1] == "-h" || $argv[1] == "--help")
die($help);
if ($argv[1] == "-v" || $argv[1] == "--version")
die($version);
if (!$conf['password'] && preg_match('/\-\-password=/iU', $argv[1]))
$conf['password'] = substr($argv[1], strlen("--password="));
if (!$conf['password'] && preg_match('/\-\-password=/iU', $argv[2]))
$conf['password'] = substr($argv[2], strlen("--password="));
if ($argv[1] == "--verbose" || $argv[2] == "--verbose")
$conf['verbose'] = true;
if (!$conf['password'])
$conf['password'] = getpw();
// ip reset
println("> current IP: ".getip());
ipreset($conf['password']);
println("> new IP: ".getip());
?>
Hallo Leute es funktioniert bei mir nicht was mache ich verkehrt klicke das an passiert nichts !!
FRITZ!Box Fon WLAN 7140 (AOL), Firmware-Version 30.04.33 !!
Ist es möglich so eine doppelklicklösung wie mit fbr.command zu erstellen das hatte so perfekt geklappt ??? Bis der neu blöden update drauf wahr !!
Ist es möglich so eine doppelklicklösung wie mit fbr.command zu erstellen das hatte so perfekt geklappt ??? Bis der neu blöden update drauf wahr !!
...daher verstehe ich die lösungswege, in denen sich ein perl-/php-skript durch irgendwelche menüs klickt nicht wirklich. die elegantere lösung ist wie gehabt via upnp mit leicht geändertem string.
...
und außerdem noch ein kleines GUI app erstellt, für alle, die das terminal nicht mögen
FritzReset-0.1.dmg
benutzung auf eigene gefahr!