Skip to content

Instantly share code, notes, and snippets.

@egaillot
Created October 10, 2013 16:37
Show Gist options
  • Save egaillot/6921454 to your computer and use it in GitHub Desktop.
Save egaillot/6921454 to your computer and use it in GitHub Desktop.
An anticipatory Christmas present, offered as a solidarity token to all the code-storists of the world who are spending their life in elevators.
#!/bin/bash -ex
#---------- You will need to adjust these values to suit your needs ---------
#---------- You shouldn't need to touch the rest of the script ---------
#---------- (That is, if you have bash in your system) ---------
export REGISTRAR_BASE_URL=http://elevator.retour1024.eu.cloudbees.net
export SERVER_URL=http://your.server.address/path/to/app
export PSEUDO=DeLift
export EMAIL=your.email@address.com
export PASSWORD_FILE=../code-elevator.password
LAUNCH_SERVER_COMMAND=your_launch_script.sh
#----------------------------------------------------------------------------
SERVER_PID=../elevator-engine.pid
unregister-server.sh
trap unregister-server.sh EXIT
kill $(cat ${SERVER_PID}) || true
LAUNCH_SERVER_COMMAND
echo $! > ${SERVER_PID}
register-server.sh
wait
#!/bin/bash -ex
curl -X POST "${REGISTRAR_BASE_URL}/resources/player/register?email=${EMAIL}&pseudo=${PSEUDO}&serverURL=${SERVER_URL}" > ${PASSWORD_FILE}
#!/bin/bash -ex
curl -u "${EMAIL}:$(cat ${PASSWORD_FILE})" -X POST "${REGISTRAR_BASE_URL}/resources/player/unregister?email=${EMAIL}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment