Kaynağa Gözat

Don't announce data users

Bob Mottram 8 yıl önce
ebeveyn
işleme
e833123ecd
1 değiştirilmiş dosya ile 8 ekleme ve 5 silme
  1. 8
    5
      src/zeronetavahi

+ 8
- 5
src/zeronetavahi Dosyayı Görüntüle

41
 TRACKER_PORT=6969
41
 TRACKER_PORT=6969
42
 ZERONET_INSTALL=$MESH_INSTALL_DIR/zeronet
42
 ZERONET_INSTALL=$MESH_INSTALL_DIR/zeronet
43
 MY_USERNAME=$USER
43
 MY_USERNAME=$USER
44
+MESH_USERNAME='fbone'
44
 
45
 
45
 BLOGS_FILE=$ZERONET_INSTALL/${PROJECT_NAME}-blogs
46
 BLOGS_FILE=$ZERONET_INSTALL/${PROJECT_NAME}-blogs
46
 MAIL_FILE=$ZERONET_INSTALL/${PROJECT_NAME}-mail
47
 MAIL_FILE=$ZERONET_INSTALL/${PROJECT_NAME}-mail
119
     fi
120
     fi
120
 
121
 
121
     # Check that this is a GUI installation with a desktop
122
     # Check that this is a GUI installation with a desktop
122
-    if [ ! -d /home/fbone/Desktop ]; then
123
+    if [ ! -d /home/$MESH_USERNAME/Desktop ]; then
123
         return
124
         return
124
     fi
125
     fi
125
 
126
 
126
     # Produce notifications if new users appear
127
     # Produce notifications if new users appear
127
     if [ -f $PREV_TOX_USERS_FILE ]; then
128
     if [ -f $PREV_TOX_USERS_FILE ]; then
128
         while IFS='' read -r line || [[ -n "$line" ]]; do
129
         while IFS='' read -r line || [[ -n "$line" ]]; do
129
-            if ! grep -q "$line" $PREV_TOX_USERS_FILE; then
130
-                # get the nick of the user
131
-                toxuser="$(echo "$line" | awk -F ' ' '{print $1}')"
130
+            if [[ $line != "Failed*" && $line != "data "* ]]; then
131
+                if ! grep -q "$line" $PREV_TOX_USERS_FILE; then
132
+                    # get the nick of the user
133
+                    toxuser="$(echo "$line" | awk -F ' ' '{print $1}')"
132
 
134
 
133
-                notify-send $"$PROJECT_NAME mesh" $"$toxuser has joined the mesh" --icon=dialog-information
135
+                    notify-send $"$PROJECT_NAME mesh" $"$toxuser has joined the mesh" --icon=dialog-information
136
+                fi
134
             fi
137
             fi
135
         done < "$CURRENT_USERS_FILE"
138
         done < "$CURRENT_USERS_FILE"
136
     fi
139
     fi