Command script not working - Raspberry?



  • Hi, not sure what i am doing wrong. I have created a script called test.sh which has the following content:

    #!/bin/bash
    a="hello world"
    echo $a >> test.txt

    it writes a text to another file called test.txt. the script works when I am running it from the command line.

    However, when I run it via triggercmd it's not doing anything. Log shows this:

    Running trigger: Hello World Command: sudo /home/pi/tmp/test.sh
    Reported: Command Ran

    But the command fails to do what it should do.

    This is what i listed in the commands.json file:

    {"trigger":"Hello World","command":"sudo /home/pi/tmp/test.sh","ground":"foreground","voice":"update","allowParams": "false"}

    I also tried without sudo, but no lock.

    Any idea what I am doing wrong?



  • @Joost-Breggeman said in Command script not working - Raspberry?:

    {"trigger":"Hello World","command":"sudo /home/pi/tmp/test.sh","ground":"foreground","voice":"update","allowParams": "false"}

    nevermind... found it. there should be an absolute path to the text file in the script


Log in to reply
 

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