Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

Install from latest release instead of master #133

Merged
merged 2 commits into from
Jun 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

show_help() {
cat << EOF
Usage: ${0##*/} [-hv] [-a ARN] [-i GROUP,GROUP,...] [-l GROUP,GROUP,...] [-s GROUP] [-p PROGRAM] [-u "ARGUMENTS"]
Usage: ${0##*/} [-hv] [-a ARN] [-i GROUP,GROUP,...] [-l GROUP,GROUP,...] [-s GROUP] [-p PROGRAM] [-u "ARGUMENTS"] [-r RELEASE]
Install import_users.sh and authorized_key_commands.

-h display this help and exit
Expand All @@ -23,6 +23,9 @@ Install import_users.sh and authorized_key_commands.
Defaults to '/usr/sbin/useradd'
-u "useradd args" Specify arguments to use with useradd.
Defaults to '--create-home --shell /bin/bash'
-r release Specify a release of aws-ec2-ssh to download from GitHub. This argument is
passed to \`git clone -b\` and so works with branches and tags.
Defaults to 'master'


EOF
Expand All @@ -39,8 +42,9 @@ LOCAL_GROUPS=""
ASSUME_ROLE=""
USERADD_PROGRAM=""
USERADD_ARGS=""
RELEASE="master"

while getopts :hva:i:l:s: opt
while getopts :hva:i:l:s:p:u:r: opt
do
case $opt in
h)
Expand Down Expand Up @@ -68,6 +72,9 @@ do
u)
USERADD_ARGS="$OPTARG"
;;
r)
RELEASE="$OPTARG"
;;
\?)
echo "Invalid option: -$OPTARG" >&2
show_help
Expand Down Expand Up @@ -97,7 +104,7 @@ tmpdir=$(mktemp -d)

cd "$tmpdir"

git clone -b master https://github.com/widdix/aws-ec2-ssh.git
git clone -b "$RELEASE" https://github.com/widdix/aws-ec2-ssh.git

cd "$tmpdir/aws-ec2-ssh"

Expand Down