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

PI Hole command not working

General Discussion
2
10
494
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
    TI_Gaming_TV
    last edited by Mar 1, 2023, 6:30 PM

    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
      TI_Gaming_TV
      last edited by Mar 1, 2023, 9:51 PM

      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
      
      
      R 1 Reply Last reply Mar 1, 2023, 10:06 PM Reply Quote 0
      • R
        Russ @TI_Gaming_TV
        last edited by Mar 1, 2023, 10:06 PM

        @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 Mar 1, 2023, 10:35 PM Reply Quote 0
        • T
          TI_Gaming_TV @Russ
          last edited by Mar 1, 2023, 10:35 PM

          @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 
          
          
          R 1 Reply Last reply Mar 1, 2023, 11:49 PM Reply Quote 0
          • R
            Russ @TI_Gaming_TV
            last edited by Mar 1, 2023, 11:49 PM

            @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 Mar 2, 2023, 7:29 AM Reply Quote 0
            • T
              TI_Gaming_TV @Russ
              last edited by Mar 2, 2023, 7:29 AM

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

              R 1 Reply Last reply Mar 2, 2023, 1:17 PM Reply Quote 0
              • R
                Russ @TI_Gaming_TV
                last edited by Russ Mar 2, 2023, 1:17 PM Mar 2, 2023, 1:17 PM

                @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 Mar 2, 2023, 3:52 PM Reply Quote 0
                • T
                  TI_Gaming_TV @Russ
                  last edited by Mar 2, 2023, 3:52 PM

                  @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
                    TI_Gaming_TV @Russ
                    last edited by Mar 2, 2023, 4:01 PM

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

                    R 1 Reply Last reply Mar 2, 2023, 10:03 PM Reply Quote 0
                    • R
                      Russ @TI_Gaming_TV
                      last edited by Mar 2, 2023, 10:03 PM

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

                      Russell VanderMey

                      1 Reply Last reply Reply Quote 0
                      6 out of 10
                      • First post
                        6/10
                        Last post