JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #21  
Old 24.10.2017, 21:01
Haustür
Guest
 
Posts: n/a
Default

Hallo,

leider komme ich auch nicht so recht mit der Anleitung zu recht.
Habe eine Homebox 2 6441 mit der Fimware 1.01.30w

Hatte vorher für den alten Router eine *.bat Datei.

Ich habe das Ganze mit dem reconnect Assistenten versucht, da mir der Rest eher wie bömische Dörfer vorkommt, was leider nicht geklappt hat.

Wenn ich es denn richtig verstanden habe, wird bei dem Shellskript von Teorax das Passwort erst in md5 und das Ergebnis in sha512 umgewandelt und im Skript "PASSWORD_HASH" durch das Ergebnis ersetzt.

Das macht man alles im Texteditor und Speicher es dann einfach als *.sh Datei ab?

Und wie sag ich dann JD, dass es beim reconnect darauf zugreifen soll? Denn bei Auswahl der *.sh Datei über Drittanwender-Reconnect kommt die Meldung mit welchem Programm die Datei ausgeführt werden soll.

Wie ihr seht bin ich da eher der Typ ratlos und überfordert.

Hilfe wäre klasse

EDIT:
Habe die Methode von rbybbl jetzt in verwendung und es klappt klasse :-) Danke an der Stelle

Last edited by Haustür; 25.10.2017 at 05:30. Reason: Frage erledigt
Reply With Quote
  #22  
Old 29.10.2017, 09:05
Haustür
Guest
 
Posts: n/a
Default

Wird bei euch auch für jeden reconnet die*.exe neu geladen, so dass man dann irgend wann die Taskleist mit x-mal *.exe voll hat?
Bei mir führt das auch immer wieder zu dem Problem, dass der reconnet dann irgendwann nicht mehr geht und eine token Fehlermeldung auftritt.

Last edited by Haustür; 29.10.2017 at 18:20. Reason: Leider findet die Telefonverbindung an der Box nach dem reconnet sich nicht mehr, bedeutet, dass das Telefon tot ist und nur
Reply With Quote
  #23  
Old 29.10.2017, 18:20
Haustür
Guest
 
Posts: n/a
Default

Leider findet die Telefonverbindung an der Box nach dem reconnet sich nicht mehr, bedeutet, dass das Telefon tot ist und nur durch Stromlosschaltung wieder eien Telefonverbindung herstellbar ist.
Reply With Quote
  #24  
Old 04.12.2017, 03:04
sumyungguy sumyungguy is offline
JD Fan
 
Join Date: Sep 2012
Posts: 72
Default Verbesserte 6441 Skript für Linux, jetzt auch für Mac

Hier findest du meine verbesserte Version von rbybbls Skript:
  • funktioniert jetz auch mit OS X / macOS , sowie Linux
  • Router IP, Passworthash, und Skript-bearbeiten, sind nicht mehr erforderlich. Einfach das Passwort deines Router in die Parameter-box in JDownloader einstellen.
  • Anleitung inbegriffen, wenn du mein Deutsch nicht verstehst, versuch doch auf English

Here's my improved version of rbybbl's script:
  • now works with OS X / macOS, as well as Linux
  • Router IP, password hashes, and script-editing no longer needed, just put your router password in JDownloader's Parameters box
  • instructions included in German and English

Code:
#!/bin/bash

# O2 Homebox 6441 reconnect script for Linux and macOS

### Anleitung - Instructions ###

# Speicher als Textdatei ab, z.B.:
# Home->Documents->JDownloader->reconnect-6441.sh
# Ausführbar in Terminal machen:
#   cd ~/Documents/JDownloader
#   chmod 755 reconnect-6441.sh
# Test mit:
#   ./reconnect-6441.sh 'routerpasswort'
# JDownloader:
# Einstellungen->Reconnect->Reconnect Methode: Drittanwender-Reconnect
# "Auswählen" Button anclicken, reconnect-6441.sh finden und auswählen.
# Router admin Passwort in die Parameter box einstellen.
# "Test" Button anclicken.

# Save as text file, for example:
# Home->Documents->JDownloader: reconnect-6441.sh
# Make executable in Terminal:
#   cd ~/Documents/JDownloader
#   chmod 755 reconnect-6441.sh
# Test with:
#   ./reconnect-6441.sh 'routerpassword'
# JDownloader:
# Settings->Reconnect->Reconnect Method: External Tool Reconnect
# Click "Select" button, navigate to reconnect-6441.sh and select.
# Enter the router admin password in the Parameter box.
# Click the "Test" button.

### History ###
# original author: rbybbl 2016-06-01
# https://board.jdownloader.org/showpost.php?p=372164&postcount=6
#
# modified by sumyungguy 2017-12-02:
#   made macOS compatible
#   working shell commands to generate hash, for Linux and macOS
#   no user configuration of script necessary:
#      use "o2.box" as router address
#      calculate password hash from argument
#   change for firmware 1.01.30, thanks to Teorax
#   added instructions
#   prints status information during reconnect

print_status () {
	# report current connection status and IP address
	echo "status:"
	ROUTER_STATUS=$(curl -s "$ROUTER_HOST/cgi/cgi_diagnostic.js?_tn=$ROUTER_TOKEN" | grep -o -e '"WANConnectStatus0.*"' -e '"WAN_IP4_Addr0.*"')
	echo "$ROUTER_STATUS"
}

if [ "$#" -gt 1 ]; then
	echo "Reconnect O2 Homebox - usage: reconnect-6441.sh 'routerpass'"
	exit
fi

ROUTER_HOST="o2.box"
CLEARPASS="$1"

if [ -n "$CLEARPASS" ]; then
	UNAMESTR=$(uname)
	if [ "$UNAMESTR" = "Darwin" ]; then
		ROUTER_PASS=$(printf "$CLEARPASS" | md5 | tr -d '\n' | shasum -a 512 | tr -d ' -')
	else
		ROUTER_PASS=$(printf "$CLEARPASS" | md5sum | tr -d '\n -' | shasum -a 512 | tr -d ' -')
	fi
	echo "Router Pass Hash: \n$ROUTER_PASS"
	echo "einloggen - logging in"
	if [ $(curl -s -d "pws=$ROUTER_PASS" "$ROUTER_HOST/login.cgi" | wc -c) -eq 0 ]; then
		echo "login gescheitert: falsches Passwort oder mit Webbrowser noch eingeloggt?"
		echo "login failed: wrong password or logged in with web browser?"
		exit 1
	fi
else
	echo "Warnung: kein Passwort - warning: no password"
fi

# get the token from index page and save as var
ROUTER_TOKEN=$(curl -s "$ROUTER_HOST/" | perl -nle 'print $& if m{data:image/gif;base64,[A-Za-z0-9+/]+///[A-Za-z0-9+/]{31}\K([^"]+)}' | base64 --decode)
echo "router token: $ROUTER_TOKEN"
print_status

# send disconnect post request
echo "WAN stop"
curl -s -d "action=wan_stop&httoken=$ROUTER_TOKEN" "$ROUTER_HOST/apply_abstract.cgi" > /dev/null
sleep 6
print_status

# send connect post request
echo "WAN start"
curl -s -d "action=wan_start&httoken=$ROUTER_TOKEN" "$ROUTER_HOST/apply_abstract.cgi" > /dev/null
sleep 6
print_status

# wait for connected state
while true
do
	if echo "$ROUTER_STATUS" | grep -Eqi '"WANConnectStatus0", "[0-9]+", "Connected"'; then
		break
	fi
	sleep 6
	print_status
done

if [ -n "$CLEARPASS" ]; then
	# send logout request
	echo "logout"
	sleep 2
	curl -s -d "" "$ROUTER_HOST/logout.cgi" > /dev/null
fi

Last edited by sumyungguy; 04.12.2017 at 03:33.
Reply With Quote
  #25  
Old 04.12.2017, 14:45
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,343
Default

@sumyungguy: Thanks for the script. It should be possible to use Liveheader script to do the same and not require any batch/curl.
I can see login request, parsing of token and then send requests.
You should be able to transform this into a Liveheader script easily
__________________
JD-Dev & Server-Admin
Reply With Quote
  #26  
Old 05.12.2017, 05:22
sumyungguy sumyungguy is offline
JD Fan
 
Join Date: Sep 2012
Posts: 72
Default

@Jiaz I was going by what the original author rbybbl said:
Quote:
Mit Live-Headers-Script geht es leider nicht, da JD keine Möglichkeit bietet eine base64-Zeichenkette zu entschlüsseln :(
In the past I've used the Reconnect Recorder, which was very easy. The problem is when I use my browser on the new router, there's no disconnect option in the web interface. Using curl in rbybbl's script, it seems to access some kind of "expertenmodus" page, but I don't know how to get that in my browser. So I'd have no idea how to manually write a Live Headers script for a page that I can't even see...??

I don't know how rbybbl figured it all out. Basically I just adapted his script to work on macOS (which doesn't support grep -P and some other things), and while I was at it I automated the password hash calculation. But otherwise I don't understand very well how it's all working. If there's something obvious I'm missing, please let me know, thanks.
Reply With Quote
  #27  
Old 02.04.2018, 02:46
IamALoony
Guest
 
Posts: n/a
Default working batch reconnect (Perl)

Thanks to rbybbl and others before, I wrapped the knowledge into a Perl script (reconnect_6441.pl).
On most systems Perl is either readily available or it can be easily installed.
  1. Place the code below into a file named reconnect_6441.pl and put it into any place you like.
  2. Configure JD reconnects to do
    method: external batch
    interpreter: 'cmd /c' (e. g. on windows)
    script: perl -- .\reconnect_6441.pl <password hash>
    start in: <path to reconnect_6441.pl>
See the code comments to obtain your <password hash>.

https: //pastebin.com/0ctzg1FY

Last edited by raztoki; 09.04.2018 at 02:33.
Reply With Quote
  #28  
Old 21.06.2018, 21:00
Haustür
Guest
 
Posts: n/a
Default

Bis vor kurzem hat bei mir das UPNP universal plug and play fritzbox funktioniert, ohne den Router so zu trennen, dass die Telefonverbindung annricht.
Jetzt habe ich die Firmware Version 1.00(AAJG.0)D14b und eine neue Homebox 2 6641 mit isdn-Anschluß und 3 Lan-Buchsen erhalten womit das leider so nicht mehr geht.
Per Liveheader wurde eine Möglichkeit gefunden, wobei wohl die Box vom Strom getrennt wird und neu startet., dauert recht lange mit 3,5 Min. und die Telefonverbindung trennt sich natürlich auch.
Gibt es da eine für einen Laien gut verständliche Alternative?

Gruß

Leider funktioniert keine der hier geposteten Möglichkeiten mit der Fimwareversion.
Mit AutoIT bricht es mit einer Fehlermeldung ab.
Das Shellscript und das Perlscript können leider auch keinen reconnect erzeugen, wobei ich mir da nicht ganz sicher bin ob ich das mal richtig gemacht habe da ich kein passwort an der Box verwende (hab auch mal die Eintragung mit dem Passwort aus den Scripts gelöscht, hatte aber auch keinen Erfolg).

Last edited by Haustür; 23.06.2018 at 20:17.
Reply With Quote
  #29  
Old 05.01.2019, 01:36
sumyungguy sumyungguy is offline
JD Fan
 
Join Date: Sep 2012
Posts: 72
Default

For some reason my shell script (above) stopped working today, I don't know what changed, but there seems to be a problem getting the status, though the other parts work.

But rather than spending time to debug it, I tried the perl script from IamALoony, which works well - thanks for that! I couldn't get it to work as an External Batch command on my Mac, so instead I made it executable with:

chmod u+x reconnect_6441.pl

Then I used External Tool Reconnect, and put the full path to the script (including the script name), eg. /Users/sumyungguy/Documents/scripts/reconnect_6441.pl
Then put the password hash, calculated as described, in the Parameter box.

Btw., you can also calculate the password hash with this command on the Mac:

printf 'yourrouterADMINpassword' | md5 | tr -d '\n' | shasum -a 512 | tr -d ' -'

Or on Linux:

printf 'yourrouterADMINpassword' | md5sum | tr -d '\n -' | shasum -a 512 | tr -d ' -'
Reply With Quote
  #30  
Old 21.07.2019, 10:55
calisto321
Guest
 
Posts: n/a
Default help compiling this script please

Hi, I found this c# script on the Internet **External links are only visible to Support Staff****External links are only visible to Support Staff** but when I try to compile it I get 3 error Messages. anyone know what is wrong?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace HomeBox6441_Reboot
{
class Program
{

private static bool completed;
private static WebBrowser browser;

[STAThread]
static void Main(string[] args)
{
var start = DateTime.UtcNow;
browser = new WebBrowser();
browser.Navigate("**External links are only visible to Support Staff**);

browser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(wb_DocumentCompleted);

while (!completed)
{
Application.DoEvents();
Thread.Sleep(1);
}

// override javascript window confirm function to return always true
var head = browser.Document.GetElementsByTagName("head")[0];
var script = browser.Document.CreateElement("script");
script.SetAttribute("type", "text/javascript");
script.SetAttribute("text", "window.alert = function () { }; window.confirm=function () { return true; }; ");
head.AppendChild(script);

// click the 'Neu starten' button
HtmlElementCollection elemenets = browser.Document.All;

foreach (HtmlElement e in elemenets)
{
if (e.GetAttribute("value") != null && e.GetAttribute("value").Equals(("Neu starten")))
{
e.InvokeMember("Click");
Console.WriteLine("Clicked");
break;
}
}

while(start.AddSeconds(10) > DateTime.UtcNow)
{
Application.DoEvents();
Thread.Sleep(1);
}

}

static void wb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
Console.WriteLine(browser.Document.Body.InnerHtml);
completed = true;
}

}
}
Reply With Quote
  #31  
Old 12.10.2021, 16:31
sumyungguy sumyungguy is offline
JD Fan
 
Join Date: Sep 2012
Posts: 72
Default

Since the latest firmware update a few weeks ago, the reconnect perl script no longer works :-( According to the message in the o2 forum from "o2_Giulia", the function to obtain a new IP number is no longer available:
Quote:
all o2 Homeboxes 2 with the designation 6441 have indeed recently received a new software update. I regret that the function you requested is no longer available. However, the IP can still be changed via the reset. Please let us know if you have any questions about this.
( The discussion is at hilfe (dot) o2online (dot) de / router-software-internet-telefonie-34/internet-reconnect-mit-o2-homebox-6441-574206 )

By "reset", she means power off and on, which takes several minutes, and can't be done automatically. So, things don't look good for using this router with JDownloader anymore. Unless Giulia is wrong, and someone can figure out how to reset the IP number from a script, probably a different modem/router would be needed. Does anyone have a suggestion for an off-the-shelf one that works with o2, and has a good reset script?

Last edited by sumyungguy; 12.10.2021 at 16:34.
Reply With Quote
  #32  
Old 12.10.2021, 17:04
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,143
Default

Well you can always script it!

And if it seems to be 100% impossible, get a smart-plug (nasty workaround...) and restart that via script although I don't know if it is very good for the router to be hard-reset this way.

By the way our core team is from germany so you can also talk to us in german if preferred

-psp-
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 14:00.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.