Created
October 17, 2015 01:45
-
-
Save vemacs/facbf933c278652f6219 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| source $1 | |
| INSTANCE=$2 | |
| INSTANCE_DEST="${DEPLOY_ROOT}${NAME}${INSTANCE}" | |
| rsync -a --exclude ".*/" --delete "${MASTER}/" "${INSTANCE_DEST}/" | |
| PORT=$(($PORT_START+$INSTANCE)) | |
| echo "Deploying with port ${PORT}" | |
| SERVER_PROPS="${INSTANCE_DEST}/server.properties" | |
| sed -i '/^server-port/d' "${SERVER_PROPS}" | |
| echo "" >> "${SERVER_PROPS}" | |
| echo "server-port=${PORT}" >> "${SERVER_PROPS}" | |
| echo "Replacing variables with instance number" | |
| find ${INSTANCE_DEST} -name '*.yml' -type f -print0 | xargs -0 sed -i "s/LOBBY_INSTANCE_NUM/${INSTANCE}/g" | |
| find ${INSTANCE_DEST} -name '*.txt' -type f -print0 | xargs -0 sed -i "s/LOBBY_INSTANCE_NUM/${INSTANCE}/g" | |
| sed -i -e "s/LOBBY_INSTANCE_NUM/${INSTANCE}/g" ${SERVER_PROPS} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment