TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Command script not working - Raspberry?

    General Discussion
    1
    2
    1.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ?
      A Former User
      last edited by

      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?

      ? 1 Reply Last reply Reply Quote 0
      • ?
        A Former User @A Former User
        last edited by

        @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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post