Commit 53767c14 authored by James Coyle's avatar James Coyle

Added upgrade script

parent 1f978566
#!/bin/bash
APP_DIR="/usr/local/bin"
TMP_DL=/tmp/cockroachdb.tgz
TMP=/tmp
set -e
function usage {
# Not used but kept for doco
printf "Cockroachdb Installer\nUsage: $1 [user]\n"
}
function getBin {
wget -O $TMP_DL https://binaries.cockroachdb.com/cockroach-latest.linux-amd64.tgz
}
function extractRoach {
mkdir -p "$APP_DIR" || exit 1
tar -xzf $TMP_DL -C $TMP || exit 1
}
function setInstallDirs {
mv $TMP/cockroach-latest*/cockroach $APP_DIR/cockroach || exit 1
rm -rf $TMP/cockroach-latest*
}
service cockroach stop
echo "Upgrading..."
getBin
extractRoach
setInstallDirs
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment