Warum macht ihr das nicht auch? Reine Neugier...
number="$1"
url="http://www2.dasoertliche.de/?form_name=search_inv&page=RUECKSUCHE&context=RUECKSUCHE&action=STANDARDSUCHE&la=de&rci=no&ph=$number"
temp=$(wget -q -O - "$url" | grep -A 10 class=\"entry)
name=$(echo "$temp" | sed -n -e 's/<[^<]*>/\ /g; s/^[^a-zA-Z0-9]*//g; 1p')
addr=$(echo "$temp" | grep " " | sed -e 's/ //g; s/ / /g; s/<[^<]*>//g;')
if [ "$name" != "" ]; then echo -n "$name"; fi
if [ "$addr" != "" ]; then echo "$addr"; fi
#!/bin/sh
number=$1
rm /var/tmp/page 2>/dev/null
url="http://www2.dasoertliche.de/?form_name=search_inv&page=RUECKSUCHE&context=RUECKSUCHE&action=STANDARDSUCHE&la=de&rci=no&ph=$number"
temp=$(wget -q -O - "$url" | grep -A 10 class=\"entry)
name=$(echo "$temp" | sed -n -e 's/<[^<]*>/\ /g; s/^[^a-zA-Z0-9]*//g; 1p')
addr=$(echo "$temp" | grep " " | sed -e 's/ //g; s/ / /g; s/<[^<]*>//g;')
while read reverse
do
if [ "$gotname" = "1" ];
then
# get address
if [ "$addr" != "" ];
then
echo "$addr";
echo "$addr" > /var/tmp/address;
break;
fi
fi
# get name
case ${reverse} in
*entry*)
name=${reverse#*\>}
name=${name%%\<*}
gotname=1
;;
esac
done < /var/tmp/page
ENDINVERS
# make it executable
chmod +x /var/tmp/invers.sh
if [ "$name" != "" ];
then
echo -n "$name";
echo -n "$name" > /var/tmp/name;
fi
rm /var/tmp/name
rm /var/tmp/address
.........
# make it executable
chmod +x /var/tmp/invers.sh
# write send script to file
cat > /var/tmp/callmessage.sh << 'ENDCALLMESSAGE'
#!/bin/sh
caller=${2}
called=${1}
# search name in contact list
entry=`cat /var/flash/debug.cfg 2>/dev/null | fgrep "#contact=${caller}:" | sed "s/#contact=${caller}://"`
name=${entry%%\;*}
address=${entry#*\;}
address=${address%\;*}
street=${address%%\;*}
zip=${address##*\;}
# name not found?
if [ -z "${name}" ]
then
# do reverse lookup at www.dasoertliche.de
/var/tmp/invers.sh ${caller}
name=`cat /var/tmp/name`
# found name?
..........
echo > /var/tmp/name
# write reverse lookup script to file
cat > /var/tmp/invers.sh << 'ENDINVERS'
#!/bin/sh
number="$1"
url="http://www2.dasoertliche.de/?form_name=search_inv&page=RUECKSUCHE&context=RUECKSUCHE&action=STANDARDSUCHE&la=de&rci=no&ph=$number"
temp=$(wget -q -O - "$url" | grep -A 10 class=\"entry)
name=$(echo "$temp" | sed -n -e 's/<[^<]*>/\ /g; s/^[^a-zA-Z0-9]*//g; 1p')
addr=$(echo "$temp" | grep " " | sed -e 's/ //g; s/ / /g; s/<[^<]*>//g;')
echo "${name}" > /var/tmp/name # Variable $name nach /var/tmp/name schreiben
echo "${addr}" > /var/tmp/address # Variable $addr nach /var/tmp/address schreiben
ENDINVERS
...
[avm_power]event: 27 not handled
Jan 5 21:02:30 telefon[679]: '/var/calllog' script not found!
sh: can't open /var/tmp/parse_telefon.sh
Jan 5 21:02:30 telefon[679]: SIGCHLD received!
mknod: /var/flash/calllog: File exists
/etc/init.d/rc.S: /var/flash/debug.cfg: line 297: cannot create /var/led: No such device or address
# write parse_telefon script to file
cat > /var/tmp/parse_telefon.sh << 'ENDPARSETEL'
.......
ENDPARSETEL
# make it executable
chmod +x /var/tmp/parse_telefon.sh
sh /var/tmp/parse_telefon.sh "${LINE}" "${CALLER}" &
/var/tmp/parse_telefon.sh <meine MSN>:TELEFON 09115403690
# cat name
Audi Zentrum N³rnberg-Marienberg
# cat address
Marienbergstr. 88, 90411 N³rnberg
Marienbergstr. 88, 90411 N³rnberg
name=$(echo "$name" | head -n 1)
addr=$(echo "$addr" | head -n 1)
echo "${name}" > /var/tmp/name
echo "${addr}" > /var/tmp/address
# cat /var/tmp/test.sh
#!/bin/sh
number="$1"
url="http://www2.dasoertliche.de/?form_name=search_inv&page=RUECKSUCHE&context=RUECKSUCHE&action=STANDARDSUCHE&la=de&rci=no&ph=$number"
temp=$(wget -q -O - "$url" | grep -A 10 class=\"entry)
name=$(echo "$temp" | sed -n -e 's/<[^<]*>/\ /g; s/^[^a-zA-Z0-9]*//g;1p')
addr=$(echo "$temp" | grep " " | sed -e 's/ //g; s/ / /g; s/<[^<]*>//g;')
name=$(echo "$name" | head -n 1)
addr=$(echo "$addr" | head -n 1)
echo "${name}" > /var/tmp/name
echo "${addr}" > /var/tmp/address
sh /var/flash/debug.cfg <RUFNUMMER>
sh /var/tmp/parse_telefon.sh "${LINE}" "${CALLER}" [B][COLOR="Red"]&[/COLOR][/B]
name=$(echo "$temp" | sed -n -e 's/<[^<]*>/\ /g; s/^[^a-zA-Z0-9]*//g;[B][COLOR="Red"] 1p'[/COLOR][/B])
name=${[COLOR="Red"]entry%%\;*[/COLOR]}
address=${[COLOR="Red"]entry#*\;[/COLOR]}
address=${[COLOR="Red"]address%\;*[/COLOR]}
street=${[COLOR="Red"]address%%\;*[/COLOR]}
zip=${[COLOR="Red"]address##*\;[/COLOR]}
cat address
strasse 1; 12345 stadt
street=${address%%\;*}
zip=${address##*\;}
_12345 stadt_