# initialize: IP=192.168.1.105 # Create new file 'doit' which will do the actual update echo LINK=\"http://$IP/pdir.spa\" > doit # Create list of memory-cells in SPA9x1 rm pdir.htm 2>/dev/null wget -q http://$IP/pdir.htm echo Receiving cell-info from phone at IP-adres $IP. cat pdir.htm |grep name|grep value|cut -d '"' -f6,14|sed s/\"/\ /|xargs -n1 echo|sed s/$/=n%3D/ > cells # preparing telephonelist: cat tel_list |sort -n |uniq|grep -v ^$|sed s/,/\;p\%3D/|sed s/\ /%20/|sed s/\ /%20/|sed s/\&/\%26/|sed s/$/\;r\%3D1/|sed =|xargs -n2 echo > items echo Created list of `cat items|wc -l` unique phone-book-entries. #list of first cells, equal to number of items in the items-list. head -n `wc -l items|cut -d' ' -f1` cells|sed =|xargs -n2 echo > cells2 # combine both lists in files cells2 and items: LINK="http://$IP/pdir.spa" cat cells2 items |sort -n|xargs -n4 echo|cut -d' ' -f2,4|sed s/\ //|xargs -n6 echo|sed s/\ /\\\&/|sed s/\ /\\\&/|sed s/\ /\\\&/|sed s/\ /\\\&/|sed s/\ /\\\&/|sed s/^/wget\ --post-data\ \'/|sed s/$/\'\ \$LINK/|sed s/^/sleep\ 10\;/ >>doit echo rm pdir.spa\* >> doit chmod 755 doit echo The first `cat items|wc -l` memory-cells will be used echo Please note the old information will be overwritten. echo An update-script is generated. This script is called doit. echo Estimated runtime of the script is `cat doit|grep wget|wc -l` times 10 sec. echo ls -l doit # removing temp-files rm pdir.htm cells cells2 items pdir.spa* 2> /dev/null