From 7e2193c1309bd939e641dbe1d99fbd1779d0e474 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Sat, 1 May 2021 14:07:30 +0500 Subject: [PATCH] added logout --- logout.sh | 6 +++++- mainmenu.sh | 6 +++--- settings-menu.sh | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 settings-menu.sh diff --git a/logout.sh b/logout.sh index 8b13789..f35bba6 100644 --- a/logout.sh +++ b/logout.sh @@ -1 +1,5 @@ - +rm $CREDENTIALS +rm $COOKIE +echo "Cleaning up.." +sleep 0.4 +exit diff --git a/mainmenu.sh b/mainmenu.sh index ec3f533..e3077f4 100644 --- a/mainmenu.sh +++ b/mainmenu.sh @@ -40,9 +40,9 @@ elif [ "$MENU" = "5" ] elif [ "$MENU" = "6" ] then echo "WIP" - sleep 2 - source mainmenu.sh - source settingsmenu.sh +# sleep 2 +# source mainmenu.sh + source settings-menu.sh elif [ "$MENU" = "clear" ] then clear diff --git a/settings-menu.sh b/settings-menu.sh new file mode 100644 index 0000000..d549f4f --- /dev/null +++ b/settings-menu.sh @@ -0,0 +1,34 @@ +echo "" +echo "Settings" +echo "" +echo "1 - Logout and Delete saved credentials" +echo "2 - Change Password" +echo "3 - Go Back" +echo "" +printf 'Please Input: ' +read -r SETTINGS + +if [ "$SETTINGS" = "1" ] +then + source logout.sh +elif [ "$SETTINGS" = "2" ] +then + source changepassword.sh +elif [ "$SETTINGS" = "back" ] +then + source mainmenu.sh +elif [ "$SETTINGS" = "clear" ] +then + sleep 0.2 + clear + source settings-menu.sh +elif [ "$SETTINGS" = "exit" ] +then + echo "Cleaning up.." + rm $COOKIE + sleep 0.2 + exit +else + echo ${red}Invalid input:${yellow} $SETTINGS ${reset} 1>&2 + source SETTINGSmenu.sh +fi