Trying to get a server to launch a python script pre launch #837
Replies: 3 comments
-
LordRalex wrote at Aug 14 2018 19:47:27 UTC: The structure for pre follows how install works. You need: "pre": [ {
"type": "command",
"commands": ["python /srv/lib/server_stuff/server_startup_scripts/garrysmod/workshop_updater2.0.py ${collectionid} ${rootDir}/garrysmod/lua/autorun/server/workshop.lua"]
}]
For reference, ${name} is not a value we populate (although I see usages for why we might want to), and ${rootdir} actually points to the root directory of the server (so would cover the /var/lib/pufferd/server/name/). |
Beta Was this translation helpful? Give feedback.
-
BitByte wrote at Aug 14 2018 19:47:27 UTC: Ah yeah, just solved the pre sturcture issue i was having, although i didn't know about the ${rootdir}, i'll use that instead Thanks :) |
Beta Was this translation helpful? Give feedback.
-
LordRalex wrote at Aug 14 2018 19:47:27 UTC: Commands also do run in the server's root, so you might have been able to just pass |
Beta Was this translation helpful? Give feedback.
-
BitByte wrote at Aug 14 2018 19:47:27 UTC:
I have tried to edit the <server_id>.json file to get my Garry's Mod to run a python script which updates the workshop content that the clients have to download. I have tried to add a new editible field for the edit server bit on pufferpanel and added the command to run in the pre[] section. Here is the json i have edited:
I have attempted to add a new field section (collectionid) here:
and this is the pre section in run:
I restarted the pufferd service and now pufferpanel says this when i do
sudo service pufferd status
:pufferd[14968]: json: cannot unmarshal string into Go struct field RunObject.pre of type map[string]interface {}
Any help into getting this to work would be great :)
Beta Was this translation helpful? Give feedback.
All reactions