From e833123ecd3eed1072e7bdffdec1b96e16c634bd Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 3 Aug 2016 15:36:59 +0100 Subject: [PATCH] Don't announce data users --- src/zeronetavahi | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/zeronetavahi b/src/zeronetavahi index c5b001d8..43194a89 100755 --- a/src/zeronetavahi +++ b/src/zeronetavahi @@ -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