Changeset 42836 for ipk/source.mipsel


Ignore:
Timestamp:
09/27/18 21:37:15 (6 years ago)
Author:
karlo
Message:

callmon sh4 optimized

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ipk/source.mipsel/tools_callmonitor/_path_/usr/local/share/titan/plugins/callmonitor1/fritzbox_msg_new.sh

    r42829 r42836  
    206206
    207207loadXML(){
    208         #ID="$1"
     208       
    209209        echo "Lese ID: $1"
    210210        $CURL --data "sid=$SID&pbid=$1" http://$FRITZBOXIP:49000/phonebook.lua  > /tmp/curlhelp7.tmp
     
    213213            if [[ $E = realName ]]; then
    214214                name=$C
    215                 #exit
    216215            fi
    217216            if [[ $E = number* ]]; then
     
    225224
    226225loadXMLsh4(){
    227         echo "Lese ID: $1"
     226        local IFS=\>   
     227        echo "Lese ID: $1"     
    228228        $CURL --data "sid=$SID&pbid=$1" http://$FRITZBOXIP:49000/phonebook.lua  > /tmp/curlhelp7.tmp
    229         while read line; do
    230                 X=`echo $line | grep realName | wc -c`
    231                 if [[ $X -gt 0 ]]; then
    232                         #E=`echo $line | cut -d'<' -f2 | cut -d'>' -f1`         
    233                         C=`echo $line | cut -d'>' -f2 | cut -d'<' -f1`
    234                         name=$C
    235                         #echo $name
     229        grep "realName\|number " /tmp/curlhelp7.tmp > /tmp/curlhelp7a.tmp
     230         
     231        while read line E; do
     232                C=`echo $E | cut -d'/' -f2`
     233               
     234                if [[ $C = realName ]]; then
     235                        name=`echo $E | cut -d'<' -f1`
    236236                fi
    237                
    238                 X=`echo $line | grep "number type" | wc -c`
    239                 if [[ $X -gt 0 ]]; then
     237                if [[ $C = number ]]; then                     
    240238                        type=`echo $line| cut -d'"' -f2 | sed s/" "//g | sed s/"home"/"privat"/g | sed s/"work"/"geschaeftl."/g | sed s/"mobile"/"mobil"/g `
    241                         tel=`echo $line | cut -d'>' -f2 | cut -d'<' -f1`
     239                        tel=`echo $E | cut -d'<' -f1 | sed s/"+49"/"0"/g| sed s/" "//g`
    242240                        echo "$tel#$name->$type"  >> $FRITZBUCH
    243241                fi
    244242                   
    245         done < /tmp/curlhelp7.tmp
     243        done < /tmp/curlhelp7a.tmp
    246244};
    247245
     
    285283loadFritzBook () {
    286284 if [ $usePhoneBook = "1" ]; then
    287         rm $FRITZBUCH
     285        if [ -f $FRITZBUCH ];   then  rm $FRITZBUCH; fi
    288286        if [ ! -f $FRITZBUCH ]; then
    289287            echo "FritzBook new -> $FRITZBUCH"
     
    291289            loadFritzBook70
    292290           
    293             rm /tmp/curlhelp1.tmp
    294             rm /tmp/curlhelp7.tmp
    295            
     291            if [ -f /tmp/curlhelp1.tmp ];   then  rm /tmp/curlhelp1.tmp; fi
     292            if [ -f /tmp/curlhelp7.tmp ];   then  rm /tmp/curlhelp7.tmp; fi
     293            if [ -f /tmp/curlhelp7a.tmp ];   then  rm /tmp/curlhelp7a.tmp; fi
    296294        fi
    297295    fi 
Note: See TracChangeset for help on using the changeset viewer.