Fix setup-grenade to pass user and host as parameter
setup-grenade was not working when defining a different username/host when running ./setup-grenade <host> [<user>]. Change-Id: Ie9590878dafbdd2e3ff8b2d9779be6cdefe671b6
This commit is contained in:
parent
4099c25b68
commit
e64184bc16
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# setup-grenade hostname [username]
|
||||
# setup-grenade [hostname [username]]
|
||||
#
|
||||
# Assumes ssh keys set up to an account with root privs
|
||||
|
||||
@ -28,13 +28,13 @@ fi
|
||||
|
||||
HOST=${1:-localhost}
|
||||
|
||||
DEST_USER=${USER:-${LOGNAME:-stack}}
|
||||
DEST_USER=${2:-${USER:-stack}}
|
||||
|
||||
set -o xtrace
|
||||
|
||||
ssh -t $DEST_USER@$HOST " \
|
||||
sudo mkdir -p ${STACK_ROOT}; \
|
||||
[[ -w ${STACK_ROOT} ]] || sudo chown `whoami` ${STACK_ROOT}; \
|
||||
[[ -w ${STACK_ROOT} ]] || sudo chown $DEST_USER ${STACK_ROOT}; \
|
||||
[[ -d $GRENADE_DIR ]] || (cd ${STACK_ROOT}; git clone $GRENADE_REPO $GRENADE_DIR); \
|
||||
[[ -d $GRENADE_DIR ]] && (cd $GRENADE_DIR; git checkout $GRENADE_BRANCH); \
|
||||
"
|
||||
|
Loading…
x
Reference in New Issue
Block a user