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

    PI Hole command not working

    Scheduled Pinned Locked Moved General Discussion
    10 Posts 2 Posters 2.1k Views 1 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.
    • T Offline
      TI_Gaming_TV
      last edited by

      I followed all the instructions given by Russ. The trigger on and off are going to my pi (i can see it over the console). Parameter off was send, but he pihole_on_off.sh file not working do not send pihole enable (same with on).

      1 Reply Last reply Reply Quote 0
      • T Offline
        TI_Gaming_TV
        last edited by

        I needed to change file permissions.
        Now i get this:

        
        /root/.TRIGGERcmdData/pihole_on_off.sh: line 2: syntax error near unexpected token '§'in\r'
        'root/. TRIGGERcmdData/pihole_on_off.sh: line 2: 'case "$1" in
        
        
        RussR 1 Reply Last reply Reply Quote 0
        • RussR Offline
          Russ @TI_Gaming_TV
          last edited by

          @TI_Gaming_TV, can you copy/paste your script here? You seem to have an error on line 2.

          Russell VanderMey

          T 1 Reply Last reply Reply Quote 0
          • T Offline
            TI_Gaming_TV @Russ
            last edited by

            @Russ

            
            root@DietPi:~# cat / root/. TRIGGERcmdData/pihole_on_off.sh 
            #/bin/bash 
            case "$1" in
            "on")
            pihole enable
            "off")
            pihole disable
            *)
            echo "Run this with on or off as the parameter."
            exit 1
            ;;
            esac 
            
            
            RussR 1 Reply Last reply Reply Quote 0
            • RussR Offline
              Russ @TI_Gaming_TV
              last edited by

              @TI_Gaming_TV, you're missing these lines:

              ;;
              

              Please try this:

              #!/bin/bash
              case "$1" in
                "on")
                  pihole enable
                  ;;
                "off")
                  pihole disable
                  ;;
                *)
                  echo "Run this with on or off as the parameter."
                  exit 1
                  ;;
              esac
              

              Russell VanderMey

              T 1 Reply Last reply Reply Quote 0
              • T Offline
                TI_Gaming_TV @Russ
                last edited by

                @Russ sry. The ;; weren’t copied because I used the iPhone photo scan. That’s not the problem

                RussR 1 Reply Last reply Reply Quote 0
                • RussR Offline
                  Russ @TI_Gaming_TV
                  last edited by Russ

                  @TI_Gaming_TV, I thought that was it because I got a similar error when I used the script you pasted above, although the error was on a different line.

                  ./pihole_on_off.sh: line 5: syntax error near unexpected token `)'
                  ./pihole_on_off.sh: line 5: `"off")'
                  

                  Can you copy/paste your actual script text here?

                  Russell VanderMey

                  T 2 Replies Last reply Reply Quote 0
                  • T Offline
                    TI_Gaming_TV @Russ
                    last edited by

                    @Russ

                    #/bin/bash
                    case "$1" in
                      "on")
                        pihole enable
                        ;;
                      "off")
                        pihole disable
                        ;;
                      *)
                        echo "Run this with on or off as the parameter."
                        exit 1
                        ;;
                    esac
                    
                    
                    1 Reply Last reply Reply Quote 0
                    • T Offline
                      TI_Gaming_TV @Russ
                      last edited by

                      @Russ now i know the problem. it was the !# in line 1. I forgot the !

                      RussR 1 Reply Last reply Reply Quote 0
                      • RussR Offline
                        Russ @TI_Gaming_TV
                        last edited by

                        @TI_Gaming_TV, awesome. So it's working now?

                        Russell VanderMey

                        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