Skip to content

Commit

Permalink
put AWS CLI check and SSH key check in init.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroTochigi committed Feb 22, 2024
1 parent e2dbe9b commit 8998336
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/aws/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ groupName=luftballons-sg
instanceName=luftballon
checkSSH=~/.ssh/$publickey

aws --version || ( echo "Run './installAwsCli.sh' first. AWS CLI is not installed." && exit 1 )

if test ! -f "$checkSSH"; then
echo "Run 'ssh-keygen' first, with an empty passphrase for no passphrase. Missing ssh key." && exit 1
fi

function importSshKey()
{
Expand Down Expand Up @@ -152,6 +148,11 @@ function init {
done
shift "$(($OPTIND -1))"

aws --version || ( echo "Run './installAwsCli.sh' first. AWS CLI is not installed." && exit 1 )

if test ! -f "$checkSSH"; then
echo "Run 'ssh-keygen' first, with an empty passphrase for no passphrase. Missing ssh key." && exit 1
fi

if [ -z $keyname ]
then
Expand Down

0 comments on commit 8998336

Please sign in to comment.