added upgrade command, added support for release channels

This commit is contained in:
FezVrasta 2015-06-25 12:56:07 +02:00
parent 2652f5f752
commit 201c8879d6
4 changed files with 29 additions and 7 deletions

1
.version Normal file
View File

@ -0,0 +1 @@
1.2

View File

@ -4,21 +4,23 @@
# 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
wget https://github.com/FezVrasta/ark-server-tools/archive/master.tar.gz
tar -zxvf master.tar.gz
wget https://github.com/FezVrasta/ark-server-tools/archive/${channel}.tar.gz
tar -zxvf ${channel}.tar.gz
# Install ARK Server Tools
cd ark-server-tools-master/tools
cd ark-server-tools-${channel}/tools
chmod +x install.sh
sh install.sh $1 > /dev/null
status=$?
# Remove the installation files
rm -f master.tar.gz
rm -rf /tmp/ark-server-tools-master
rm -f ${channel}.tar.gz
rm -rf /tmp/ark-server-tools-${channel}
# Print messages
case "$status" in

View File

@ -318,8 +318,23 @@ case "$1" in
status)
printStatus
;;
upgrade)
echo "arkmanager v${arkstVersion}: Checking for updates...
arkstLatestVersion=`curl -s https://raw.githubusercontent.com/FezVrasta/ark-server-tools/${arkstChannel}/.version`
if [ $arkstLatestVersion -gt $arkstVersion ]; then
read -p "A new version was found! Do you want to upgrade ARK Server Tools to v${$arkstLatestVersion}?" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
curl -s https://raw.githubusercontent.com/FezVrasta/ark-server-tools/${arkstChannel}/netinstall.sh | sudo bash -s ${steamcmd_user} ${arkstChannel}
else
exit 0
fi
else
echo "Your ARK server tools are already up to date"
fi
;;
-h|--help)
echo -e "Usage: arkmanager [OPTION]\n"
echo -e "Usage: arkmanager[OPTION]\n"
echo "Option Description"
echo "start Starts the server"
echo "stop Stops the server"
@ -330,9 +345,10 @@ case "$1" in
echo "checkupdate Check for a new ARK server version"
echo "boradcast PLACEHOLDER, not supported yet"
echo "status Returns the status of the current ARK server instance"
echo "upgrade Check for a new ARK Server Tools version and upgrades it if needed"
;;
*)
echo "arkmanager: no command specified"
echo "arkmanager v${arkstVersion}: no command specified"
echo "Try 'arkmanager -h' or 'arkmanager --help' for more information."
;;
esac

View File

@ -1,3 +1,6 @@
arkstVersion="1.2" # used to print the version when needed and to check for updates
arkstChannel="master" # change it to a different branch to get non-stable versions
# config SteamCMD
steamcmdroot="/home/steam/steamcmd" # path of your steamcmd instance
steamcmdexec="steamcmd.sh" # name of steamcmd executable