More mesh translations
This commit is contained in:
parent
215ee869a7
commit
185524a8f0
src
|
@ -36,7 +36,7 @@ PROJECT_NAME='freedombone'
|
|||
export TEXTDOMAIN=$PROJECT_NAME
|
||||
export TEXTDOMAINDIR="/usr/share/locale"
|
||||
|
||||
WEB_PAGE_TITLE="Freedombone Mesh"
|
||||
WEB_PAGE_TITLE=$"${PROJECT_NAME} Mesh"
|
||||
TRACKER_PORT=6969
|
||||
ZERONET_INSTALL=/opt/zeronet
|
||||
ZERONET_USER_HOME=/home/zeronet
|
||||
|
@ -59,11 +59,22 @@ ZERONET_CONFIG=$ZERONET_INSTALL/bootstrap
|
|||
|
||||
IPFS_PORT=4001
|
||||
|
||||
MY_BLOG_STR=$"My Blog"
|
||||
MY_MAIL_STR=$"My Mail"
|
||||
MY_FORUM_STR=$"My Forum"
|
||||
BLOGS_STR=$"Blogs"
|
||||
MAIL_STR=$"Mail"
|
||||
FORA_STR=$"Fora"
|
||||
ZERONET_BLOG_STR=$"ZeroNet Blog"
|
||||
ZERONET_MAIL_STR=$"ZeroNet Mail"
|
||||
ZERONET_FORUM_STR=$"ZeroNet Forum"
|
||||
NO_USERS_STR=$"No users found"
|
||||
|
||||
function create_index {
|
||||
if [ -f $ZERONET_INDEX ]; then
|
||||
sed -i "s|.*My Blog.*| <li><a href=\"$(cat /home/$MY_USERNAME/.config/zeronet/myblog)\">My Blog</a></li>|g" $ZERONET_INDEX
|
||||
sed -i "s|.*My Mail.*| <li><a href=\"$(cat /home/$MY_USERNAME/.config/zeronet/mymail)\">My Mail</a></li>|g" $ZERONET_INDEX
|
||||
sed -i "s|.*My Forum.*| <li><a href=\"$(cat /home/$MY_USERNAME/.config/zeronet/myforum)\">My Forum</a></li>|g" $ZERONET_INDEX
|
||||
sed -i "s|.*${MY_BLOG_STR}.*| <li><a href=\"$(cat /home/$MY_USERNAME/.config/zeronet/myblog)\">${MY_BLOG_STR}</a></li>|g" $ZERONET_INDEX
|
||||
sed -i "s|.*${MY_MAIL_STR}.*| <li><a href=\"$(cat /home/$MY_USERNAME/.config/zeronet/mymail)\">${MY_MAIL_STR}</a></li>|g" $ZERONET_INDEX
|
||||
sed -i "s|.*${MY_FORUM_STR}.*| <li><a href=\"$(cat /home/$MY_USERNAME/.config/zeronet/myforum)\">${MY_FORUM_STR}</a></li>|g" $ZERONET_INDEX
|
||||
return
|
||||
fi
|
||||
echo '<!DOCTYPE html>' > $ZERONET_INDEX
|
||||
|
@ -77,18 +88,18 @@ function create_index {
|
|||
echo "<H2>Your Sites</H2>" >> $ZERONET_INDEX
|
||||
echo '' >> $ZERONET_INDEX
|
||||
echo '<ol type="square">' >> $ZERONET_INDEX
|
||||
echo " <li><a href=\"$(cat /home/$MY_USERNAME/.config/zeronet/myblog)\">My Blog</a></li>" >> $ZERONET_INDEX
|
||||
echo " <li><a href=\"$(cat /home/$MY_USERNAME/.config/zeronet/mymail)\">My Mail</a></li>" >> $ZERONET_INDEX
|
||||
echo " <li><a href=\"$(cat /home/$MY_USERNAME/.config/zeronet/myforum)\">My Forum</a></li>" >> $ZERONET_INDEX
|
||||
echo " <li><a href=\"http://localhost:5001/webui\">File Share</a></li>" >> $ZERONET_INDEX
|
||||
echo " <li><a href=\"$(cat /home/$MY_USERNAME/.config/zeronet/myblog)\">${MY_BLOG_STR}</a></li>" >> $ZERONET_INDEX
|
||||
echo " <li><a href=\"$(cat /home/$MY_USERNAME/.config/zeronet/mymail)\">${MY_MAIL_STR}</a></li>" >> $ZERONET_INDEX
|
||||
echo " <li><a href=\"$(cat /home/$MY_USERNAME/.config/zeronet/myforum)\">${MY_FORUM_STR}</a></li>" >> $ZERONET_INDEX
|
||||
# echo " <li><a href=\"http://localhost:5001/webui\">File Share</a></li>" >> $ZERONET_INDEX
|
||||
echo '</ol>' >> $ZERONET_INDEX
|
||||
echo '' >> $ZERONET_INDEX
|
||||
echo "<H2>On the Mesh</H2>" >> $ZERONET_INDEX
|
||||
echo '' >> $ZERONET_INDEX
|
||||
echo '<ol type="square">' >> $ZERONET_INDEX
|
||||
echo " <li><a href=\"${BLOGS_FILE}.html\">Blogs</a></li>" >> $ZERONET_INDEX
|
||||
echo " <li><a href=\"${MAIL_FILE}.html\">Mail</a></li>" >> $ZERONET_INDEX
|
||||
echo " <li><a href=\"${FORUM_FILE}.html\">Fora</a></li>" >> $ZERONET_INDEX
|
||||
echo " <li><a href=\"${BLOGS_FILE}.html\">${BLOGS_STR}</a></li>" >> $ZERONET_INDEX
|
||||
echo " <li><a href=\"${MAIL_FILE}.html\">${MAIL_STR}</a></li>" >> $ZERONET_INDEX
|
||||
echo " <li><a href=\"${FORUM_FILE}.html\">${FORA_STR}</a></li>" >> $ZERONET_INDEX
|
||||
echo " <li><a href=\"${TOX_USERS_FILE}.html\">Tox Users</a></li>" >> $ZERONET_INDEX
|
||||
echo '</ol>' >> $ZERONET_INDEX
|
||||
echo '' >> $ZERONET_INDEX
|
||||
|
@ -166,7 +177,7 @@ if [ -f $BLOGS_FILE.new ]; then
|
|||
rm -f $BLOGS_FILE.new
|
||||
fi
|
||||
|
||||
cat $TEMPFILE_BASE | grep "ZeroNet Blog\|hostname =\|address =\|port =\|txt =" > $TEMPFILE
|
||||
cat $TEMPFILE_BASE | grep "${ZERONET_BLOG_STR}\|hostname =\|address =\|port =\|txt =" > $TEMPFILE
|
||||
|
||||
state=0
|
||||
address=""
|
||||
|
@ -192,7 +203,7 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
|
|||
state=2
|
||||
fi
|
||||
fi
|
||||
if [[ $line == *"ZeroNet Blog"* && $line == "= "* ]]; then
|
||||
if [[ $line == *"${ZERONET_BLOG_STR}"* && $line == "= "* ]]; then
|
||||
state=1
|
||||
fi
|
||||
done < "$TEMPFILE"
|
||||
|
@ -204,7 +215,7 @@ if [ -f $MAIL_FILE.new ]; then
|
|||
rm -f $MAIL_FILE.new
|
||||
fi
|
||||
|
||||
cat $TEMPFILE_BASE | grep "ZeroNet Mail\|hostname =\|address =\|port =\|txt =" > $TEMPFILE
|
||||
cat $TEMPFILE_BASE | grep "${ZERONET_MAIL_STR}\|hostname =\|address =\|port =\|txt =" > $TEMPFILE
|
||||
|
||||
state=0
|
||||
address=""
|
||||
|
@ -230,7 +241,7 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
|
|||
state=2
|
||||
fi
|
||||
fi
|
||||
if [[ $line == *"ZeroNet Mail"* && $line == "= "* ]]; then
|
||||
if [[ $line == *"${ZERONET_MAIL_STR}"* && $line == "= "* ]]; then
|
||||
state=1
|
||||
fi
|
||||
done < "$TEMPFILE"
|
||||
|
@ -242,7 +253,7 @@ if [ -f $FORUM_FILE.new ]; then
|
|||
rm -f $FORUM_FILE.new
|
||||
fi
|
||||
|
||||
cat $TEMPFILE_BASE | grep "ZeroNet Forum\|hostname =\|address =\|port =\|txt =" > $TEMPFILE
|
||||
cat $TEMPFILE_BASE | grep "${ZERONET_FORUM_STR}\|hostname =\|address =\|port =\|txt =" > $TEMPFILE
|
||||
|
||||
state=0
|
||||
address=""
|
||||
|
@ -268,7 +279,7 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
|
|||
state=2
|
||||
fi
|
||||
fi
|
||||
if [[ $line == *"ZeroNet Forum"* && $line == "= "* ]]; then
|
||||
if [[ $line == *"${ZERONET_FORUM_STR}"* && $line == "= "* ]]; then
|
||||
state=1
|
||||
fi
|
||||
done < "$TEMPFILE"
|
||||
|
@ -318,7 +329,7 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
|
|||
fi
|
||||
done < "$TEMPFILE"
|
||||
if [ $toxctr -eq "0" ]; then
|
||||
echo " <li>No users found</li>" >> $TOX_USERS_FILE.new
|
||||
echo " <li>${NO_USERS_STR}</li>" >> $TOX_USERS_FILE.new
|
||||
fi
|
||||
echo '<ol>' >> $TOX_USERS_FILE.new
|
||||
|
||||
|
@ -339,10 +350,10 @@ if [ -d $ZERONET_USER_HOME ]; then
|
|||
fi
|
||||
|
||||
# make some html headers and footers
|
||||
create_header $BLOGS_FILE "Blogs"
|
||||
create_header $MAIL_FILE "Mail"
|
||||
create_header $FORUM_FILE "Fora"
|
||||
create_header $TOX_USERS_FILE "Tox Users"
|
||||
create_header $BLOGS_FILE $BLOGS_STR
|
||||
create_header $MAIL_FILE $MAIL_STR
|
||||
create_header $FORUM_FILE $FORA_STR
|
||||
create_header $TOX_USERS_FILE $"Tox Users"
|
||||
create_footer $BLOGS_FILE
|
||||
create_footer $MAIL_FILE
|
||||
create_footer $FORUM_FILE
|
||||
|
|
Loading…
Reference in New Issue