Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A bash script to download the nexus botclient installer
#!/bin/bash
# Latest version is always available at: https://gist.github.com/815751
#
# The MIT License
#
# Copyright (c) 2011 Kyle Gibson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
VERSION=0.2
URL=http://impsoft.info/click-to-install-bot-client.jar
function main() {
cat << EOT
============================================================
RSBOTS DOWNLOAD & INSTALL SCRIPT $VERSION
THIS SCRIPT WILL:
1) DOWNLOAD THE RSBOTS.NET BOT CLIENT INSTALLER JAR
2) RUN THE INSTALLER JAR
DO NOT CLOSE THIS WINDOW
EOT
which wget > /dev/null
if [ $? -ne 0 ]; then
cat << __EOT
============================================================
'wget' command is not installed
- How to fix: install wget (apt-get, yum)
__EOT
read
return
fi
which java > /dev/null
if [ $? -ne 0 ]; then
cat << __EOT
============================================================
'java' command is not installed
- How to fix: install java (apt-get, yum)
__EOT
read
return
fi
echo Java version: $(java -version 2>&1 | head -n1 | awk '{print $NF;}')
read -p "Press Enter to proceed "
wget $URL
java -jar $(basename $URL) &
bash
wait
}
( flock -xn 200 && main ) 200> ~/.botinstaller.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment