Don't announce data users

This commit is contained in:
Bob Mottram 2016-08-03 15:36:59 +01:00
parent 4eafa5884e
commit e833123ecd
1 changed files with 8 additions and 5 deletions

View File

@ -41,6 +41,7 @@ WEB_PAGE_TITLE=$"${PROJECT_NAME} Mesh"
TRACKER_PORT=6969
ZERONET_INSTALL=$MESH_INSTALL_DIR/zeronet
MY_USERNAME=$USER
MESH_USERNAME='fbone'
BLOGS_FILE=$ZERONET_INSTALL/${PROJECT_NAME}-blogs
MAIL_FILE=$ZERONET_INSTALL/${PROJECT_NAME}-mail
@ -119,18 +120,20 @@ function detect_new_tox_users {
fi
# Check that this is a GUI installation with a desktop
if [ ! -d /home/fbone/Desktop ]; then
if [ ! -d /home/$MESH_USERNAME/Desktop ]; then
return
fi
# Produce notifications if new users appear
if [ -f $PREV_TOX_USERS_FILE ]; then
while IFS='' read -r line || [[ -n "$line" ]]; do
if ! grep -q "$line" $PREV_TOX_USERS_FILE; then
# get the nick of the user
toxuser="$(echo "$line" | awk -F ' ' '{print $1}')"
if [[ $line != "Failed*" && $line != "data "* ]]; then
if ! grep -q "$line" $PREV_TOX_USERS_FILE; then
# get the nick of the user
toxuser="$(echo "$line" | awk -F ' ' '{print $1}')"
notify-send $"$PROJECT_NAME mesh" $"$toxuser has joined the mesh" --icon=dialog-information
notify-send $"$PROJECT_NAME mesh" $"$toxuser has joined the mesh" --icon=dialog-information
fi
fi
done < "$CURRENT_USERS_FILE"
fi