Browse Source

Prevent multiple instances of username entry dialog from running

Bob Mottram 7 years ago
parent
commit
239614e8e8
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/freedombone-image-customise

+ 4
- 0
src/freedombone-image-customise View File

781
     echo '' >> $START_DESKTOP
781
     echo '' >> $START_DESKTOP
782
     echo 'INITIAL_TOX_USERNAME=""' >> $START_DESKTOP
782
     echo 'INITIAL_TOX_USERNAME=""' >> $START_DESKTOP
783
     echo 'while [ ${#INITIAL_TOX_USERNAME} -eq 0 ]; do' >> $START_DESKTOP
783
     echo 'while [ ${#INITIAL_TOX_USERNAME} -eq 0 ]; do' >> $START_DESKTOP
784
+    echo '  username_dialog_count=$(ps aux | grep zenity | wc -l)' >> $START_DESKTOP
785
+    echo '  if [ $username_dialog_count -gt 1 ]; then' >> $START_DESKTOP
786
+    echo '    exit 0' >> $START_DESKTOP
787
+    echo '  fi' >> $START_DESKTOP
784
     echo "  data=\$(zenity --forms --title=\"$MESH_TITLE\" --text=\"$MESH_SET_USERNAME\" --separator=\",\" --add-entry=\"Username\")" >> $START_DESKTOP
788
     echo "  data=\$(zenity --forms --title=\"$MESH_TITLE\" --text=\"$MESH_SET_USERNAME\" --separator=\",\" --add-entry=\"Username\")" >> $START_DESKTOP
785
     echo '  accepted=$?' >> $START_DESKTOP
789
     echo '  accepted=$?' >> $START_DESKTOP
786
     echo '  if ((accepted == 0)); then' >> $START_DESKTOP
790
     echo '  if ((accepted == 0)); then' >> $START_DESKTOP