PI Hole command not working
-
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).
-
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
-
@TI_Gaming_TV, can you copy/paste your script here? You seem to have an error on line 2.
-
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
-
@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
-
@Russ sry. The ;; weren’t copied because I used the iPhone photo scan. That’s not the problem
-
@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?
-
#/bin/bash case "$1" in "on") pihole enable ;; "off") pihole disable ;; *) echo "Run this with on or off as the parameter." exit 1 ;; esac
-
@Russ now i know the problem. it was the !# in line 1. I forgot the !
-
@TI_Gaming_TV, awesome. So it's working now?