Changeset 10562


Ignore:
Timestamp:
10/21/11 11:43:15 (11 years ago)
Author:
sofatester
Message:

[titan IPK] Update Callmonitor -> Thx GOst

Location:
ipk/source.sh4/titaninfos_callmonitor
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • ipk/source.sh4/titaninfos_callmonitor/CONTROL/control

    r10367 r10562  
    11Package: titan-plugin-infos-callmonitor
    2 Version: 0.3
     2Version: 0.5
    33Architecture: sh4
    44OE: Callmonitor for your AAF Duckbox
  • ipk/source.sh4/titaninfos_callmonitor/var/usr/local/share/titan/plugins/callmonitor1/callmon.conf

    r10367 r10562  
    11FRITZBOXIP=10.0.0.99
     2FritzPass=hugo
     3usePhoneBook=0
    24Alle=1
    35anzeigewennaus=0
  • ipk/source.sh4/titaninfos_callmonitor/var/usr/local/share/titan/plugins/callmonitor1/fritzbox_msg_new.sh

    r10367 r10562  
    33CONFIG=`echo "$0callmon.conf" | sed s/fritzbox_msg_new.sh//`
    44NC=`echo "$0nc" | sed s/fritzbox_msg_new.sh//`
     5ICONV=`echo "$0iconv" | sed s/fritzbox_msg_new.sh//`
     6CURL=`echo "$0curl" | sed s/fritzbox_msg_new.sh//`
     7LPATH=`echo "$0" | sed s/'\/fritzbox_msg_new.sh'//`
     8LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LPATH
     9export LD_LIBRARY_PATH
    510
    611. $CONFIG
     
    7479#additional paths to files we use (will be created automatically if not present)
    7580#detecting Dreambox-Type (DM7020 or DM7000 or DM500 or DM600PVR)
    76  FRITZCACHE=/var/fritzbox.cache                  #stores successfull reverse searches
     81 FRITZCACHE=/tmp/fritzbox.cache                  #stores successfull reverse searches
     82 FRITZBUCH=/var/fritzbuch.tele
    7783 TMPFILE=/tmp/fritzbox.tmp                       #stores page from wget command
    7884 TMPSTATUS=/tmp/fritzdream.status                #status der Dreambox (standby usw)
     
    192198fi;
    193199};
     200
     201loadFritzBook () {
     202 if [ $usePhoneBook = "1" ]; then
     203                if [ ! -f $FRITZBUCH ]; then
     204                        # Challenge abholen
     205                        ChallengeXML=`wget -O - "http://$FRITZBOXIP/cgi-bin/webcm?getpage=../html/login_sid.xml" 2>/dev/null| grep Challenge`
     206                        Challenge=`echo $ChallengeXML | awk '{match($0,/>[^<>]+</); print substr($0,RSTART+1,RLENGTH-2)}'`
     207                        Passwd="$FritzPass"
     208
     209                        # login aufbauen und hashen
     210                        CPSTR="$Challenge-$Passwd"
     211                        MD5=`echo -n $CPSTR | $ICONV -f ISO8859-1 -t UTF-16LE > /tmp/help; md5sum /tmp/help | awk '{print substr($0,1,32)}'`
     212                        RESPONSE="$Challenge-$MD5"
     213                        POSTDATA="login:command/response=$RESPONSE&getpage=../html/de/menus/menu2.html"
     214                        # login senden und SID herausfischen
     215                        SID=`wget -O - --post-data="$POSTDATA" "http://$FRITZBOXIP/cgi-bin/webcm" 2>/dev/null| grep "name=\"sid\"" | head -1 | awk '{match($0,/value="[^"]+"/); print substr($0,RSTART+7,RLENGTH-8)}'`
     216
     217                        ./$CURL --data "telcfg:settings/Phonebook/Books/Select=0&getpage=../html/de/menus/menu2.html&var:pagename=fonbuch&sid=$SID&var:menu=fon&var:lang=de" http://$FRITZBOXIP/cgi-bin/webcm  | grep ">TrFon" | sed s/'<script type="text\/javascript">'// | sed s/';<\/script>'// | sed s/'('/'"'/ | sed s/')'/'"'/ > /tmp/curlhelp.tmp
     218
     219                        while read line
     220                                do
     221                                art=`echo $line | cut -d'"' -f1`
     222                                if [ $art = "TrFonName" ]; then
     223                                        name=`echo $line | cut -d'"' -f5`
     224                                elif [ $art = "TrFonNr" ]; then
     225                                        nummer=`echo $line | cut -d'"' -f5`
     226                                        echo "$nummer#$name" >> $FRITZBUCH
     227                                fi
     228                        done < /tmp/curlhelp.tmp
     229                        rm /tmp/curlhelp.tmp
     230                fi
     231                cp $FRITZBUCH $FRITZCACHE
     232        fi     
     233};
    194234#-------------------------------------------------------------------------------
    195235#Script has been initiated with parameters
     
    210250  echo "Anzeigetimeout: " $anzeigetimeout
    211251  echo "Anzeigewennaus: " $anzeigewennaus
    212   echo "Übersichtsseite: " $uebersichtsseite
     252  #echo "Übersichtsseite: " $uebersichtsseite
     253  echo "Fritzbox Telefonbuch: " $usePhoneBook
    213254  echo "------------------------------------"
    214  
     255  loadFritzBook
    215256  if [ $debug = 0 ]; then
    216257     wget -q -O /dev/null "http://$ip/cgi-bin/xmessage?caption=Skript%20gestartet&body=FritzBox!%20Callmonitor%20gestartet&timeout=3"
     
    476517 
    477518  TEST|test)
     519                loadFritzBook
    478520      echo "Testing the script: "$0
    479521      mysearch "$2"
     
    511553      if [ -f $TMPFILE ];     then  rm $TMPFILE; fi
    512554      if [ -f $TMPSTATUS ];     then  rm $TMPSTATUS; fi
    513       ;;
    514   install|INSTALL) #only for DM7020 at the moment
    515      #kill all processes we spawned
    516      #hopefully only a single tail task is running so we kill it :)
    517      echo 'Killing spawned processes...'     
    518      pid=`ps | grep "tail.-f"| grep -v grep | awk '{print $1}'`
    519      if [ "X${pid}" != "X" ] ; then
    520         kill -9 ${pid}
    521      fi
    522      pid=`ps |grep "Unbekannt" | grep -v grep | awk '{print $1}'`
    523      if [ "X${pid}" != "X" ] ; then
    524         kill -9 ${pid}
    525      fi
    526      pid=`ps |grep ".*nc.*$TELDPORT" | grep -v grep | awk '{print $1}'`
    527      if [ "X${pid}" != "X" ] ; then
    528         kill -9 ${pid}
    529      fi
    530      #pid=`ps |grep $SCRIPT | grep -v grep | awk '{print $1}'`
    531      #if [ "X${pid}" != "X" ] ; then
    532      #   kill -9 ${pid}
    533      #fi 
    534      #here starts the installer 
    535      if [ "$DREAMTYPE" = "DM7020" ]; then
    536           cp $SCRIPT /etc/fritzbox_msg_new.sh
    537           #rm /etc/rc2.d/S40Fritz
    538       #ln -s /etc/fritzbox_msg_new.sh /etc/rc2.d/S40Fritz    #create softlinks in rcX
    539           update-rc.d `basename $0`  start 41 S . stop  39 0 1 6 .
    540       echo ''
    541       echo "You should now test the script with"
    542       echo $SCRIPT 'TEST 089906426'
    543       echo ''
    544       echo 'If it works correct, reboot your dreambox!'
    545       echo ''
    546      fi
    547      ;;
    548   remove|REMOVE)
    549      #kill all processes we spawned
    550      #hopefully only a single tail task is running so we kill it :)
    551      echo 'Killing spawned processes...'
    552      pid=`ps | grep "tail.-f"| grep -v grep | awk '{print $1}'`
    553      if [ "X${pid}" != "X" ] ; then
    554         kill -9 ${pid}
    555      fi
    556      pid=`ps |grep "Unbekannt" | grep -v grep | awk '{print $1}'`
    557      if [ "X${pid}" != "X" ] ; then
    558         kill -9 ${pid}
    559      fi
    560      pid=`ps |grep ".*nc.*$TELDPORT" | grep -v grep | awk '{print $1}'`
    561      if [ "X${pid}" != "X" ] ; then
    562         kill -9 ${pid}
    563      fi
    564      #pid=`ps |grep $SCRIPT | grep -v grep | awk '{print $1}'`
    565      #if [ "X${pid}" != "X" ] ; then
    566      #   kill -9 ${pid}
    567      #fi 
    568     #here starts the uninstaller
    569     if [ "$DREAMTYPE" = "DM7020" ]; then
    570       #rm /etc/rc2.d/S40Fritz                                                   #remove softlink in rc2
    571           update-rc.d -f `basename $0` remove
    572         fi
    573     echo ''
    574     echo 'If you want a complete cleanup you can execute:'
    575     echo '   /bin/sh '"$SCRIPT"' cleanup'
    576     echo ''
    577     echo 'and then   rm '"$SCRIPT"
    578     echo ''
    579     ;;         
     555  ;;
     556  loadPhoneBook|loadphonebook)
     557        rm $FRITZBUCH
     558        loadFritzBook
     559  ;;
    580560esac
    581561
Note: See TracChangeset for help on using the changeset viewer.