Linux Server - No GUI - Add Background commands



  • Hello,

    Looking for some guidance on how I can add background commands to run a script instead of the 4 defaults that are added as part of the install. I feel like I missed something.

    CentOS and agent is installed as a service.


  • administrators

    @laakness, I wonder if this is what you're missing. You're running a script instead of a command in one of the folders in your PATH, so you have to specify the folder where the script lives. AND, because commands.json has to be in json format, you have to escape your forward slashes with backslashes. Here's the basic format. Notice the \'s

    {"trigger":"My Awesome Script","command":"\/root\/coolscript.sh","ground":"background","voice":"awesome"},


  • @russ Thanks. That does help for the formatting of the command but what I'm asking is where do I actually configure that from a server with no GUI?

    I tried to edit the commands.json but it gets overwritten once the service is restarted.

    Where do I actually configure the commands, I'm not seeing it in the web and most of the examples on the site show the Windows GUI.


  • administrators

    @laakness, I see. Your commands.json file will get over-written if it has bad json formatting in it. That's why I like the GUI because it handles the json formatting for you.

    One common mistake that can mess up json is having a comma at the end of the last record.

    If you copy/paste your json data here (before it gets over-written) I could probably spot the problem.

    Or, you could use https://jsonformatter.curiousconcept.com to check your json.



  • @russ you are the man.

    That was it, I was missing a comma. You'd think after working with kubernetes and yaml files all week I would have run it through a format validator :)

    Nice work on this app btw.


  • administrators

    Thanks @laakness. I'm learning Kubernetes myself.

    I made this video showing it off: https://www.youtube.com/watch?v=MyvRFbHErJQ


Log in to reply
 

Looks like your connection to TRIGGERcmd Forum was lost, please wait while we try to reconnect.