freedombone-mesh-reset 1.9KB

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