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

    Command script not working - Raspberry?

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 1 Posters 1.5k Views 2 Watching
    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.
    • ? Offline
      [[global: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
      • ? Offline
        [[global:former-user]] @Guest
        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

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post