Skip to content

Commit

Permalink
Use consistent naming for installer script variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jhkolb committed Mar 7, 2018
1 parent 86d2b14 commit 0c701d0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions installer/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ if [ ! -e /etc/spawnd/config.yml ]; then
bw2Entity: {{entity}}
path: {{path}}
alias: {{alias}}
memory: {{memAlloc}}
memory: {{memory}}
cpuShares: {{cpuShares}}
bw2Agent: 172.17.0.1:28589
EOF

entity=''
path=''
memAlloc=''
memory=''
cpuShares=''
if [ -n "$SPAWND_INSTALLER_ENTITY" ]; then
entity="$SPAWND_INSTALLER_ENTITY"
Expand All @@ -131,10 +131,10 @@ if [ ! -e /etc/spawnd/config.yml ]; then
fi
sdAlias="$(echo "$path" | awk -F'/' '{print $NF}')"

if [ -n "$SPAWND_INSTALLER_MEM_ALLOC" ]; then
memAlloc="$SPAWND_INSTALLER_MEM_ALLOC"
if [ -n "$SPAWND_INSTALLER_MEMORY" ]; then
memory="$SPAWND_INSTALLER_MEMORY"
else
memAlloc="$(whiptail --nocancel --inputbox "Memory allocation for this Spawnpoint, in MiB (e.g. 2048):" \
memory="$(whiptail --nocancel --inputbox "Memory allocation for this Spawnpoint, in MiB (e.g. 2048):" \
10 78 --title "Memory Allocation" 3>&1 1>&2 2>&3)"
fi

Expand All @@ -151,7 +151,7 @@ if [ ! -e /etc/spawnd/config.yml ]; then
$sh_c "sed -i 's#{{entity}}#/etc/spawnd/$entityFile#' /etc/spawnd/config.yml"
$sh_c "sed -i 's#{{path}}#$path#' /etc/spawnd/config.yml"
$sh_c "sed -i 's#{{alias}}#$sdAlias#' /etc/spawnd/config.yml"
$sh_c "sed -i 's#{{memAlloc}}#$memAlloc#' /etc/spawnd/config.yml"
$sh_c "sed -i 's#{{memory}}#$memory#' /etc/spawnd/config.yml"
$sh_c "sed -i 's#{{cpuShares}}#$cpuShares#' /etc/spawnd/config.yml"
$sh_c "chown spawnd:spawnd /etc/spawnd/config.yml"

Expand Down

0 comments on commit 0c701d0

Please sign in to comment.