Last active
July 23, 2017 09:52
-
-
Save TurBoss/f3c7db52844e0c8aafb625b3a7b44cce 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 | |
#branches develop release | |
BRANCH="develop" | |
date=$(date) | |
OUTPUT=$(python /home/spring/scripts/upq.py) | |
VERSION=$(echo "$OUTPUT" | cut -d' ' -f1) | |
# BRANCH2=$(echo "$OUTPUT" | cut -d' ' -f2) | |
echo "$OUTPUT" | |
echo "$date" | |
echo "$BRANCH" | |
echo "$VERSION" | |
file="/home/spring/log/latestEngine" | |
latest=$(cat $file) | |
spadsCfg="/home/spring/spads-develop/etc/spads.conf" | |
if [ "$VERSION" != "$latest" ] | |
then | |
echo "$date" | |
echo "NEW VERSION FOUND" | |
#Stop running instance | |
sudo systemctl stop spads-develop.service | |
#Get lastest engine version | |
cd /home/spring/ || return | |
pr-downloader --download-engine "$OUTPUT" # > /dev/null 2>&1 | |
rm "/home/spring/.spring/engine/spring_{develop}%s_minimal-portable-linux64-static.7z" "$VERSION" | |
#configure spads | |
cd /home/spring/spads-develop || return | |
sed -i "s/^\(springServer\:\).*\$/\1\/home\/spring\/\.spring\/engine\/$OUTPUT\/spring-dedicated/" $spadsCfg | |
sleep 10 | |
printf "/home/spring/.spring/engine/%s/libunitsync.so\n\n\n" "$OUTPUT" | ./spadsInstaller.pl -g # > /dev/null 2>&1 | |
echo "$VERSION" > /home/spring/log/latestEngine | |
#Start a new instance | |
sudo systemctl start spads-develop.service | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment