Use zenity for mesh identity reset

This commit is contained in:
Bob Mottram 2017-10-28 20:43:26 +01:00
parent 239614e8e8
commit af9806f462
1 changed files with 17 additions and 23 deletions

View File

@ -33,28 +33,22 @@ export TEXTDOMAINDIR="/usr/share/locale"
MESH_INSTALL_COMPLETED=/root/.mesh_setup_completed
dialog --title $"New Identity" \
--backtitle $"Freedombone Mesh" \
--defaultno \
--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
sel=$?
case $sel in
0) sudo batman stop
sudo pkill qtox
sudo pkill firefox
sudo pkill iceweasel
sudo pkill midori
sudo pkill patchwork
sudo rm -f $MESH_INSTALL_COMPLETED
sudo ${PROJECT_NAME}-image-mesh $USER new
sudo batman start
if [ -f $HOME/mesh-desktop.sh ]; then
$HOME/mesh-desktop.sh
else
dialog --title $"New Identity" \
--msgbox $"You now have a new identity" 6 40
fi
;;
esac
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; then
sudo batman stop
sudo pkill qtox
sudo pkill firefox
sudo pkill iceweasel
sudo pkill midori
sudo pkill patchwork
sudo rm -f $MESH_INSTALL_COMPLETED
sudo ${PROJECT_NAME}-image-mesh $USER new
sudo batman start
if [ -f $HOME/mesh-desktop.sh ]; then
$HOME/mesh-desktop.sh
else
dialog --title $"New Identity" \
--msgbox $"You now have a new identity" 6 40
fi
fi
exit 0