Jump to content
marceldev89

Arma 3 Linux server and mod updater (workshop)

Recommended Posts

Arma 3 Linux server and mod updater (workshop)

A python script that updates your server and mods. Just edit the variables in the "Configuration" region to your liking and run the script. :-)

 

Features:

  • Update Linux server binaries
  • Download mods from the Steam Workshop
  • Update mods from the Steam Workshop
  • Converts all mod files and folders to lowercase
  • Creates symbolic links with human readable names (e.g. 620260972 becomes @alive)

 

Non-features (for now):

  • Setting up the basic dedicated server
  • Manage keys

 

Requirements:

  • Python 3
  • steamcmd
  • Steam account with an Arma 3 license (only required for downloading mods from the workshop)

 

License:

MIT

 

Download:

Arma 3 Linux server and mod updater (workshop)

  • Like 5
  • Thanks 1

Share this post


Link to post
Share on other sites

Running ubuntu 14 I get ::

 

Downloading item 450814997 ...
ERROR! Download item 450814997 failed (Failure).

 

Server updating seems to work but not the mods......

Share this post


Link to post
Share on other sites

New error:

 

Traceback (most recent call last):
  File "modupdate.py", line 157, in <module>
    update_mods()
  File "modupdate.py", line 104, in update_mods
    if mod_needs_update(mod_id, path):
  File "modupdate.py", line 84, in mod_needs_update
    response = request.urlopen("{}/{}".format(WORKSHOP_CHANGELOG_URL, mod_id)).r                                                                                                             ead()
NameError: global name 'request' is not defined

Share this post


Link to post
Share on other sites

I fixed it:

 

changed "from urllib import request to import urllib2

 

and

 

response = request.urlopen("{}/{}".format(WORKSHOP_CHANGELOG_URL, mod_id)).read() to response = urllib2.urlopen("{}/{}".format(WORKSHOP_CHANGELOG_URL, mod_id)).read()

 

Works great now, many thanks..........

Share this post


Link to post
Share on other sites
On 12/20/2017 at 3:12 PM, marceldev89 said:

Requirements:

  • Python 3

 

The script is supposed to be ran with Python 3. :)

Share this post


Link to post
Share on other sites

Yea well guess that would depend on which version of linux you are running. But hey now you know it will run on Python 2.7 with a couple of small changes.

 

Now if there was a way to get it to run a bash file after updating i.e. ./server.sh start, it would be perfect.

Share this post


Link to post
Share on other sites

Hi marcel !

How should i understand this :

"find: ‘rename’: Aucun fichier ou dossier de ce type" (translate: no file or folder of that type)

 

Is this an error, or is it just the ouput if  there is no file that need to be lowercased?

All the script seems to worked properly, but when i launch the server, mod doesn't load. Im trying to find from where come my fault..

Damn.. SOLVED : Rename is a packet. he wasn't installed on my distro.
Apt-get install rename
and now its all okay...
Great script Marcel ! Thanks for this job !

Share this post


Link to post
Share on other sites

Oops, haven't checked the forums in a while and turned off notification emails. ^^

I assumed that the rename command is more or less standard on the major distributions but if it comes up again I'll add it to the requirements. :)

  • Like 1

Share this post


Link to post
Share on other sites

Hi Marcel, thanks for this python script! I'm facing a bug/problem with steamcmd parameters

sh: 1: +force_install_dir: not found

 

I changed A3_SERVER_DIR variable like so

...

A3_SERVER_DIR = "/home/quackorduck/steamcmd/arma3"

...

def update_server():
    steam_cmd_params  = " +login {} {}".format(STEAM_USER, STEAM_PASS)
    steam_cmd_params += " +force_install_dir {}".format(A3_SERVER_DIR)
    steam_cmd_params += " +app_update {} validate".format(A3_SERVER_ID)
    steam_cmd_params += " +quit"

    call_steamcmd(steam_cmd_params)

...

 

I can verify the directory exists by using

cd /home/quackorduck/steamcmd/arma3

and it brings me to the directory where I installed my server.

 

Could it be a typo or a bug I'm facing?

 

UPDATE:

 

It seems that my password contains an ampersand; '&' symbol which makes python go crazy. I solved it by inserting '\' before '&'. *facepalm* Now it WORKS!

Edited by quackortheduck

Share this post


Link to post
Share on other sites

Yeah I always forget to escape the ampersand.. :D

 

You can also leave the password field empty, steamcmd will then ask for your password the first time it runs and will use the cached authentication stuff for a while after that.

  • Like 1

Share this post


Link to post
Share on other sites

There's another bug I'm facing. When I tried adding a mod in the list variable, it downloads and deleted afterwards.

================================
Updating "@tfar" (620019431) | 1
================================
Redirecting stderr to '/home/quackorduck/Steam/logs/stderr.txt'
Looks like steam didn't shutdown cleanly, scheduling immediate update check
[  0%] Checking for available updates...
[----] Verifying installation...
Steam Console Client (c) Valve Corporation
-- type 'quit' to exit --
Loading Steam API...OK.

Logging in user 'quackortheduck' to Steam Public...Logged in OK
Waiting for user info...OK
Downloading item 620019431 ...
Success. Downloaded item 620019431 to "/home/quackorduck/steamcmd/arma3/steamapps/workshop/content/107410/620019431" (166388040 bytes) 

================================
Updating "@tfar" (620019431) | 2
================================

...

================================
Updating "@tfar" (620019431) | 10
================================

...

=========================================
!! Updating @tfar failed after 10 tries !!
=========================================

 

If I tried downloading manually by using steamcmd, the mod was saved inside the workshop folder and it managed to create a symlink for the mod. Do you know what's happening?

Share this post


Link to post
Share on other sites

All the script does is asking steamcmd to download a mod and when the new folders doesn't exist in the workshop folder after the download finishes it'll try again. Whenever I ran into this issue there was either a problem with the workshop service or some steamcmd cache issue. You can try clearing the steamcmd cache but I can't remember what the actual files to delete for that are so you'll have to figure that out yourself (probably a file named <a3_steam_id>.<some_steam_extension>).

  • Like 1

Share this post


Link to post
Share on other sites

I keep getting permission denied i have tried filling in the login info and leaving it blank nothing works  help please

 

=============
Updating mods
=============

==================================
Updating "@cba_a3" (450814997) | 1
==================================
sh: 1: /home/gamemaster/steamcmd: Permission denied


==================================
Updating "@cba_a3" (450814997) | 2
==================================
sh: 1: /home/gamemaster/steamcmd: Permission denied

Share this post


Link to post
Share on other sites

You don't have permissions to run steamcmd apparently. Either run the script as the "gamemaster" user or fix the permissions.

Share this post


Link to post
Share on other sites

The "@" name can be whatever you want it to be. It's just for your own sanity and doesn't _need_ to be something specific.

Share this post


Link to post
Share on other sites

Thanks. I thought it might matter for when people select the server for mods needed.

 

Share this post


Link to post
Share on other sites

Hello, thank's for script!

 

But i have a probleme.  (I use linuxgsm for install arma 3)


==================================
Updating "@cba_a3" (450814997) | 3
==================================
Redirecting stderr to '/home/arma3server/Steam/logs/stderr.txt'
[  0%] Checking for available updates...
[----] Verifying installation...
Steam Console Client (c) Valve Corporation
-- type 'quit' to exit --
Loading Steam API...CreateBoundSocket: ::bind couldn't find an open port between 27060 and 27060
OK.

Logging in user 'armagroupe' to Steam Public...Logged in OK
Waiting for user info...OK
Downloading item 450814997 ...
ERROR! Download item 450814997 failed (Failure).

log:

sh: 1: /home/arma3server/steamcmd/linux32/../ubuntu12_64/gldriverquery: not found
sh: 1: /home/arma3server/steamcmd/linux32/../ubuntu12_32/gldriverquery: not found
sh: 1: /home/arma3server/steamcmd/linux32/../ubuntu12_64/vulkandriverquery: not found
CApplicationManagerPopulateThread took 0 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)
CAppInfoCacheReadFromDiskThread took 14 milliseconds to initialize

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×