mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
12db6bfe8f
git-svn-id: https://svn.fhem.de/fhem/trunk@126 2b470e98-0d58-463d-a4d8-8e2adae1ed80
31 lines
857 B
Bash
Executable File
31 lines
857 B
Bash
Executable File
#!/bin/bash
|
|
# this skript creates for e.g. the Siemens C470 IP a telephone book which can be read in by the webinterface of the telephone
|
|
# The script reads the /etc/asterisk/extensions.conf and creates the /tmp/teledir.vcf
|
|
# Martin Haas 071216
|
|
#
|
|
|
|
# you need the tool unix2dos :-( It is depending on your Distribution included in unix2dos or tofrodos
|
|
|
|
telefonbook=/tmp/teledir.vcf
|
|
|
|
rm -f $telefonbook
|
|
|
|
grep System /etc/asterisk/extensions.conf | grep -v '^;' | \
|
|
|
|
while read fhemdev
|
|
do
|
|
number=$(echo $fhemdev | cut -d, -f1 | awk '{print $3}')
|
|
name=$(echo $fhemdev | cut -d\" -f2 | sed 's/\./ /g')
|
|
|
|
echo "BEGIN:VCARD" >>$telefonbook
|
|
echo "VERSION:2.1" >>$telefonbook
|
|
echo "FN:$name" >>$telefonbook
|
|
echo "N:$name" >>$telefonbook
|
|
echo "TEL;HOME:$number" >>$telefonbook
|
|
echo "END:VCARD" >>$telefonbook
|
|
echo >>$telefonbook
|
|
|
|
done
|
|
|
|
unix2dos $telefonbook
|