Skip to content
Snippets Groups Projects
Commit 276e463e authored by Bob Mottram's avatar Bob Mottram
Browse files

Fixing content discovery

parent 3383f27e
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment