From 1cae47d9f8e1afc6abdd076581213c7353cd97ab Mon Sep 17 00:00:00 2001 From: Matt Theissen Date: Sat, 17 Jul 2021 22:08:56 -0500 Subject: [PATCH] Corrected typos and added part of the menu --- ddbank.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ddbank.sh b/ddbank.sh index 47d1c0c..3e803f6 100755 --- a/ddbank.sh +++ b/ddbank.sh @@ -5,7 +5,7 @@ bal="43.00" ## SSH Config ssh_user="theissenm" -ssh_host="knd-db01.kniod.corp +ssh_host="knd-db01.kniod.corp" @@ -13,12 +13,12 @@ ssh_host="knd-db01.kniod.corp new_account() { read -p "Enter the name of your account: " user1 echo "Your account name will be $user1." - read -p "Is that correct? [y/N]" yn + read -p "Is that correct? [y/N] " yn case $yn in # If user selects yes. Insert their username and a timestamp into the database. - [Yy]* ) ssh $ssh_user$ssh_host "psql -U ddbank -d ddbank -c \"insert into account (username,timestamp) values ('$user1','now');\"" 2>/dev/null || echo "Username already taken."; + [Yy]* ) ssh $ssh_user@$ssh_host "psql -U ddbank -d ddbank -c \"insert into account (username,timestamp) values ('$user1','now');\"" 2>/dev/null || echo "Username already taken."; # Sets the user's id as the variable. user1_id=$(ssh $ssh_user@$ssh_host "psql -U ddbank -d ddbank -c \"select id from account where username='$user1';\"" | awk 'FNR == 3 {print}') @@ -48,11 +48,11 @@ new_account() { # Menu -echo "This is the first option." -echo "This is the second" -echo "This is the third" +echo "1) Create new user account." +echo "2) List user accounts." +echo "3) List user(s) balance." echo " " -read -p "What is your option?: " i +read -p "Select from the menu above: " i if [ $i == 1 ] then new_account