Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script to auto-apply updates pulled down with factorio-updater #7

Closed
JyeGuru opened this issue Jul 28, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@JyeGuru
Copy link

commented Jul 28, 2016

Just sharing this script which I knocked together to streamline my updating process for my server. I have this script symlinked into each factorio install folder, and a simple ./update in that folder will pull down and apply the latest version.

#!/bin/sh

FACTORIO_BINARY=./bin/x64/factorio
FACTORIO_PACKAGE=core-linux_headless64
FACTORIO_UPDATEDIR=./updater-temp

key="$1"
case $key in
        -s|stable|--stable)
        EXPERIMENTAL=
        echo "Set to STABLE release mode!"
        ;;
        -e|-x|experimental|--experimental)
        EXPERIMENTAL=-x
        echo "Set to EXPERIMENTAL release mode!"
        ;;
        *)
        EXPERIMENTAL=
        echo "Defaulting to STABLE release mode. To set EXPERIMENTAL release mode, please use '$0 experimental'"
        ;;
esac

mkdir -p $FACTORIO_UPDATEDIR
FACTORIO_VERSION=`$FACTORIO_BINARY --version |awk 'NR==1{print $2}'`
./update_factorio.py -p $FACTORIO_PACKAGE -f $FACTORIO_VERSION $EXPERIMENTAL -O $FACTORIO_UPDATEDIR

if compgen -G "$FACTORIO_UPDATEDIR/*.zip" >/dev/null; then
for f in `ls -tr $FACTORIO_UPDATEDIR/*.zip`
        do
                $FACTORIO_BINARY --apply-update $f && rm $f
        done
fi

FACTORIO_VERSION=`$FACTORIO_BINARY --version |awk 'NR==1{print $2}'`
echo ""
echo "***** ***** ***** ***** ***** ***** ***** ***** *****"
echo "Factorio version is now: $FACTORIO_VERSION"
@narc0tiq

This comment has been minimized.

Copy link
Owner

commented Aug 2, 2016

That's very cool, particularly with the auto-detection of the current Factorio version. You could perhaps also use the presence of a file (perhaps named EXPERIMENTAL?) to turn experimental updates on/off automatically without having to pass an argument.

@narc0tiq narc0tiq changed the title Script to auto-apply updates pulled down factorio-updater Script to auto-apply updates pulled down with factorio-updater Aug 30, 2016

@jocker-il

This comment has been minimized.

Copy link

commented Nov 15, 2016

I assume I can use this in LGSM (linux game-server-manager) ?

@narc0tiq narc0tiq closed this May 24, 2017

narc0tiq added a commit that referenced this issue May 24, 2017

Merge #19 (auto-apply updates, ver detect)
Closes #15, closes #7. Most of the way through #17, but does not
currently provide a way to auto-delete downloads after successful
update.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.