Created
May 3, 2020 10:16
-
-
Save mlowen/ac93b3a49fc4038343b9e811befb28fc to your computer and use it in GitHub Desktop.
This file contains 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 | |
set -e | |
if [[ ! -z $(which rr) ]]; then | |
echo rr is already installed, bailing now. | |
exit 1 | |
fi | |
if [[ -z $(which java) ]]; then | |
echo Java is not installed please install before rr | |
exit 1 | |
fi | |
VERSION="1.62" | |
if [[ ! -z "$1" ]]; then | |
VERSION=$1 | |
fi | |
RR_NAME="rr-$VERSION-java8" | |
REMOTE_ARCHIVE="https://github.com/GuntherRademacher/rr/releases/download/v$VERSION/$RR_NAME.zip" | |
LOCAL_ARCHIVE="/tmp/$RR_NAME.zip" | |
# Just some test directories | |
INSTALL_DIR="/usr/local/etc/$RR_NAME" | |
LAUNCH_SCRIPT=/usr/local/bin/rr | |
curl -sSL $REMOTE_ARCHIVE -o $LOCAL_ARCHIVE | |
unzip -qq $LOCAL_ARCHIVE -d $INSTALL_DIR | |
rm -f $LOCAL_ARCHIVE | |
cat > $LAUNCH_SCRIPT <<- EOF | |
#! /bin/bash | |
java -jar $INSTALL_DIR/rr.war \$@ | |
EOF | |
chmod +x $LAUNCH_SCRIPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment