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

Commit

Permalink
Install from latest release instead of master (#133)
Browse files Browse the repository at this point in the history
Add argument to install script to specify release
  • Loading branch information
AMeng authored and michaelwittig committed Jun 27, 2018
1 parent 47786b5 commit abf073a
Showing 1 changed file with 10 additions and 3 deletions.
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

0 comments on commit abf073a

Please sign in to comment.