[Eisfair] [e1] dyneisfair 1.1.4 IP wird nicht upgedatet

Fabian Törner toerner at gmx.net
Fr Feb 28 18:02:32 CET 2014


Hallo Jürgen,

heute Nacht gab es wieder ein IP Wechsel und wurde wieder nicht geupdatet :(

Am 27.02.2014 21:24, schrieb Juergen Edner:
> probiere doch einmal die auf dieser Seite gezeigten Skripte aus.
> Laut diesen Informationen soll eine Modifikation bei neuen Firmware-
> Varianten notwendig sein:
>
> http://www.wehavemorefun.de/fritzbox/Statusanfragen_per_UPnP

Meine Script Kenntnisse sind leider nicht besonders gut :(

eis # /tmp/fabian/fritztest.sh -ip
/tmp/fabian/fritztest.sh: line 33: warning: here-document at line 23 
delimited by end-of-file (wanted `EOF')
eis # cat /tmp/fabian/fritztest.sh
#!/bin/bash

NETCAT=`which netcat`
[ -z "$NETCAT" ] && NETCAT=`which nc`
[ -z "$NETCAT" ] && exit 1

INTERFACE_NS="urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1"
WANIP_NS="urn:schemas-upnp-org:service:WANIPConnection:1"

if [ "$1" = "-ip" ]; then
     NS="$WANIP_NS"
     REQUEST="GetExternalIPAddress"
     SED='/^<NewExternalIP/ s,</\?NewExternalIPAddress>,,gp'
else
     NS="$INTERFACE_NS"
     REQUEST="GetAddonInfos"
     if [ "$1" = "-a" ]; then
         SED='s,<New,<, ; /^<[a-zA-Z]*[ >]/ s,^<\([^> ]*\) 
*>\([^<]*\)</.*,\1\t\2,p'
     else
         SED='s/Send/OUT/ ; s/Receive/IN/ ; /^<NewByte/ 
s,^<NewByte\([^>]*\)Rate>\([^<]*\)<.*,\1\t\2,gp'
     fi
fi
  ( $NETCAT 192.168.178.1 49000 | sed -ne "$SED" ) <<EOF
  POST /upnp/control/WANCommonIFC1 HTTP/1.1
  Content-Type: text/xml; charset="utf-8"
  HOST: 192.168.178.1:49000
  Content-Length: 0
  SOAPACTION: "$NS#$REQUEST"
  <?xml version="1.0" encoding="utf-8"?>
  <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" 
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <s:Body><u:$REQUEST xmlns:u=$NS /></s:Body>
  </s:Envelope>
  EOF
eis #

eis # /tmp/fabian/fritztest.sh -ip
/tmp/fabian/fritztest.sh: line 33: warning: here-document at line 23 
delimited by end-of-file (wanted `EOF')
eis #


*zweites Script*

eis # cat /tmp/fabian/fritztest1.sh
#!/bin/bash

FRITZ_IP=192.168.178.1

NETCAT=`which netcat`
[ -z "$NETCAT" ] && NETCAT=`which nc`
[ -z "$NETCAT" ] && exit 1

( [ -n "$FRITZ_IP" ] && $NETCAT -z $FRITZ_IP 49000 ) || exit 1;

INTERFACE_NS="urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1"
WANIP_NS="urn:schemas-upnp-org:service:WANIPConnection:1"

if [ "$1" = "-ip" ]; then
         NS="$WANIP_NS"
         REQUEST="GetExternalIPAddress"
         SED='/^<NewExternalIP/ s,</\?NewExternalIPAddress>,,gp'
else
         NS="$INTERFACE_NS"
         REQUEST="GetAddonInfos"
         if [ "$1" = "-a" ]; then
                 SED='s,<New,<, ; /^<[a-zA-Z]*[ >]/ s,^<\([^> ]*\) 
*>\([^<]*\)</.
*,\1\t\2,p'
         else
                 SED='s/Send/OUT/ ; s/Receive/IN/ ; /^<NewByte/ 
s,^<NewByte\([^>]
*\)Rate>\([^<]*\)<.*,\1\t\2,gp'
         fi
fi

body="<?xml version=\"1.0\" encoding=\"utf-8\"?> \
<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" \
s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\
<s:Body><u:$REQUEST xmlns:u=$NS /></s:Body>\
</s:Envelope>"

( $NETCAT $FRITZ_IP 49000 | sed -ne "$SED"  ) <<EOF
POST /upnp/control/WANCommonIFC1 HTTP/1.1
Content-Type: text/xml; charset="utf-8"
HOST: $FRITZ_IP:49000
Content-Length: ${#body}
SOAPACTION: "$NS#$REQUEST"

$body
EOF
 
                                     eis #

eis # /tmp/fabian/fritztest1.sh -ip
eis # /tmp/fabian/fritztest1.sh
sed: -e expression #1, char 59: unterminated `s' command
eis # /tmp/fabian/fritztest1.sh -all
sed: -e expression #1, char 59: unterminated `s' command
eis # /tmp/fabian/fritztest1.sh -ip



*python Script*


eis # cat /tmp/fabian/fritztest3.sh
#!/usr/bin/env python
from SOAPpy import SOAPProxy
print 
SOAPProxy(proxy='http://192.168.178.1:49000/upnp/control/WANCommonIFC1',
       namespace='urn:schemas-upnp-org:service:WANIPConnection:1',
 
soapaction='urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress',
       noroot=True).GetExternalIPAddress()
eis #

eis # /tmp/fabian/fritztest3.sh -ip
Traceback (most recent call last):
   File "/tmp/fabian/fritztest3.sh", line 2, in <module>
     from SOAPpy import SOAPProxy
ImportError: No module named SOAPpy
eis # /tmp/fabian/fritztest3.sh
Traceback (most recent call last):
   File "/tmp/fabian/fritztest3.sh", line 2, in <module>
     from SOAPpy import SOAPProxy
ImportError: No module named SOAPpy



Habe mit den Scripts so kein Glück :(

Vielen Dank & viele Grüße
Fabian




Mehr Informationen über die Mailingliste Eisfair