Corrected typos and added part of the menu

master
Matt Theissen 4 years ago
parent 484f1e0a47
commit 1cae47d9f8

@ -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