Make directory listing of tftpboot in xml

Create function to create a directory listing in xml for use by external apps to make download requests more specific
Remove mkringlist.sh from tftpboot
Output from createTftpBootXml Structure included
This commit is contained in:
steve-lad
2021-07-14 14:58:47 +02:00
parent b214fee18a
commit 09b259c85e
3 changed files with 37 additions and 24 deletions

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env bash
outfile=ringlist.xml
echo -e "<CiscoIPPhoneRingList>" >$outfile
if [ ! -z "`ls *.pcm 2>/dev/null`" ]; then
for filename in *.pcm;do
basename=`basename ${filename} .pcm`
echo -e "\t<Ring>" >>$outfile
echo -e "\t\t<DisplayName>${basename}</DisplayName>" >>$outfile
echo -e "\t\t<FileName>ringtones/${filename}</FileName>" >>$outfile
echo -e "\t</Ring>" >>$outfile
done
fi
if [ ! -z "`ls *.raw 2>/dev/null`" ]; then
for filename in *.raw;do
basename=`basename ${filename} .raw`
echo -e "\t<Ring>" >>$outfile
echo -e "\t\t<DisplayName>${basename}</DisplayName>" >>$outfile
echo -e "\t\t<FileName>ringtones/${filename}</FileName>" >>$outfile
echo -e "\t</Ring>" >>$outfile
done
fi
echo -e "</CiscoIPPhoneRingList>" >>$outfile