ark-ac-server-tools/netinstall.sh
2015-09-02 16:53:41 +10:00

40 lines
1.2 KiB
Bash

#!/bin/bash
#
# Net Installer, used with curl
#
channel=${2:-master} # if defined by 2nd argument install the defined version, otherwise install master
# Download and untar installation files
cd /tmp
COMMIT="`curl -L -k -s https://api.github.com/repos/FezVrasta/ark-server-tools/git/refs/heads/${channel} | sed -n 's/^ *"sha": "\(.*\)",.*/\1/p'`"
mkdir ark-server-tools-${channel}
cd ark-server-tools-${channel}
curl -L -k -s https://github.com/FezVrasta/ark-server-tools/archive/${COMMIT}.tar.gz | tar xz
# Install ARK Server Tools
cd ark-server-tools-${COMMIT}/tools
sed -i "s|^arkstCommit='.*'$|arkstCommit='${COMMIT}'|" arkmanager
chmod +x install.sh
sh install.sh $1 > /dev/null
status=$?
rm -rf /tmp/ark-server-tools-${channel}
# Print messages
case "$status" in
"0")
echo "ARK Server Tools were correctly installed in your system inside the home directory of $1!"
;;
"1")
echo "Something where wrong :("
;;
"2")
echo "WARNING: A previous version of ARK Server Tools was detected in your system, your old configuration was not overwritten. You may need to manually update it."
echo "ARK Server Tools were correctly installed in your system inside the home directory of $1!"
;;
esac