freedombone-mesh-reset 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. # _____ _ _
  3. # | __|___ ___ ___ _| |___ _____| |_ ___ ___ ___
  4. # | __| _| -_| -_| . | . | | . | . | | -_|
  5. # |__| |_| |___|___|___|___|_|_|_|___|___|_|_|___|
  6. #
  7. # Freedom in the Cloud
  8. #
  9. # Resets the identity of a mesh user
  10. #
  11. # License
  12. # =======
  13. #
  14. # This program is free software: you can redistribute it and/or modify
  15. # it under the terms of the GNU Affero General Public License as published by
  16. # the Free Software Foundation, either version 3 of the License, or
  17. # (at your option) any later version.
  18. #
  19. # This program is distributed in the hope that it will be useful,
  20. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. # GNU Affero General Public License for more details.
  23. #
  24. # You should have received a copy of the GNU Affero General Public License
  25. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  26. PROJECT_NAME='freedombone'
  27. export TEXTDOMAIN=${PROJECT_NAME}-mesh-reset
  28. export TEXTDOMAINDIR="/usr/share/locale"
  29. MESH_INSTALL_COMPLETED=/root/.mesh_setup_completed
  30. if ! zenity --question --title=$'New Identity' --text=$"Do you want to reset your identity? This will reset ALL data for this peer, and you will not be able to recover it." --ok-label=No --cancel-label=Yes --width=300; then
  31. sudo batman stop
  32. sudo pkill qtox
  33. sudo pkill firefox
  34. sudo pkill iceweasel
  35. sudo pkill midori
  36. sudo pkill patchwork
  37. sudo rm -f $MESH_INSTALL_COMPLETED
  38. sudo "${PROJECT_NAME}-image-mesh" "$USER" new
  39. sudo batman start
  40. if [ -f "$HOME/mesh-desktop.sh" ]; then
  41. "$HOME/mesh-desktop.sh"
  42. else
  43. zenity --info --title=$"New Identity" --text=$"You now have a new identity" --width=200
  44. fi
  45. fi
  46. exit 0