Fixing content discovery

This commit is contained in:
Bob Mottram 2015-09-03 15:36:48 +01:00
parent 3383f27ee0
commit 276e463e30
1 changed files with 7 additions and 6 deletions

View File

@ -147,7 +147,7 @@ if [ -f $BLOGS_FILE.new ]; then
rm -f $BLOGS_FILE.new
fi
cat $TEMPFILE_BASE | grep "ZeroNet Blog\|hostname =\|address =\|port =\|txt-record =" > $TEMPFILE
cat $TEMPFILE_BASE | grep "ZeroNet Blog\|hostname =\|address =\|port =\|txt =" > $TEMPFILE
state=0
address=""
@ -155,9 +155,10 @@ peer=""
echo '<ol type="square">' >> $BLOGS_FILE.new
while IFS='' read -r line || [[ -n "$line" ]]; do
if [ ${state} -eq "3" ]; then
if [[ $line == *"txt-record ="* ]]; then
if [[ $line == *"txt ="* ]]; then
blog_url=$(echo $line | awk -F '[' '{print $2}' | awk -F ']' '{print $1}')
echo " <li><a href=\"${blog_url}\">${peer}</a></li>" >> $BLOGS_FILE.new
echo $blog_url
echo " <li><a href=${blog_url}>${peer}</a></li>" >> $BLOGS_FILE.new
state=0
fi
fi
@ -184,7 +185,7 @@ if [ -f $FORUM_FILE.new ]; then
rm -f $FORUM_FILE.new
fi
cat $TEMPFILE_BASE | grep "ZeroNet Forum\|hostname =\|address =\|port =\|txt-record =" > $TEMPFILE
cat $TEMPFILE_BASE | grep "ZeroNet Forum\|hostname =\|address =\|port =\|txt =" > $TEMPFILE
state=0
address=""
@ -192,9 +193,9 @@ peer=""
echo '<ol type="square">' >> $FORUM_FILE.new
while IFS='' read -r line || [[ -n "$line" ]]; do
if [ ${state} -eq "3" ]; then
if [[ $line == *"txt-record ="* ]]; then
if [[ $line == *"txt ="* ]]; then
forum_url=$(echo $line | awk -F '[' '{print $2}' | awk -F ']' '{print $1}')
echo " <li><a href=\"${forum_url}\">${peer}</a></li>" >> $FORUM_FILE.new
echo " <li><a href=${forum_url}>${peer}</a></li>" >> $FORUM_FILE.new
state=0
fi
fi