Posts by redespace

    Hi Iridium,

    Thank you for replying so quickly :)

    OK it's weird. 2 days later I tried the same script and it works now :S

    Maybe it was a network issue? Anyways, tried the command and got:

    Code
    MyPI:~ # docker logs /pihole |paste
    chown: cannot access '/etc/pihole/dhcp.leases': No such file or directory
    http://ix.io/28XT

    Not sure if the 'chown' error is a problem or not?

    Hi Guys,

    I tried installing pihole on the Raspberry PI, which is running libreelec. This is what I did:

    1. SSH to Rpi

    2. Ran:

    docker run -d --name pihole --cap-add NET_ADMIN -p 53:53/tcp -p 53:53/udp -p 80:80 -e DNS1=127.0.0.1 -e DNS2=1.1.1.1 -v /etc/localtime:/etc/localtime -v /storage/.config/pihole/:/etc/pihole -v /storage/.config/pihole/dnsmasq.d/:/etc/dnsmasq.d -v /storage/.config/pihole/html/:/var/www/html/html/ -h $(cat /etc/hostname) -e ServerIP=$(ip route get 127.0.0.1 | awk '{ print $NF; exit }') -e WEBPASSWORD=xxxx123 --restart=unless-stopped pihole/pihole:latest

    3. Ran 'docker ps':

    Code
    CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS                    PORTS                                                                         NAMES
    8d03253c7d62        pihole/pihole:latest   "/s6-init"               45 seconds ago      Up 43 seconds (heal.thy)   0.0.0.0:53->53/tcp, 0.0.0.0:80->80/tcp, 0.0.0.0:53->53/udp, 67/udp, 443/tcp   pihole

    The problem is that when I try to access the admin interface, I get "Connection Refused".

    Any ideas how to solve it?

    vpeter

    Actually I used and it worked :):

    http://user:[email protected]:58080/jsonrpc)

    Now I am suffering with the script.. grrr. I'm not a unix guy. My Script:

    MyPI:~/.config # more testscript.sh

    Code
    myvar=""
    myvar=$(curl -s -H 'Content-Type: application/json' -d '{"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "p roperties": ["tvshowid"], "playerid": 1}, "id": "VideoGetItem"}' http://user:[email protected]:58080/json rpc)
    
    echo $myvar
    if [[ $myvar == *"unknown"* ]]
    then
    echo "NOT PLAYING"
    else
    echo "PLAYING"
    fi

    MyPI:~/.config #

    MyPI:~/.config # ./testscript.sh

    {"id":"VideoGetItem","jsonrpc":"2.0","result":{"item":{"label":"","type":"unknown"}}}

    PLAYING

    MyPI:~/.config #

    The variable is storing the output correctly, but I don't seem to find away how to check if the variable contains 'unknown' :S The problem seems to be the IF statement with the pattern matching.

    Any ideas are welcome :)

    vpeter

    I just tried it but is not returning any output. (I changed the port to my own)

    MyPI:~/.config # curl -H 'Content-Type: application/json' -d '{"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["tvshowid"], "playerid": 1}, "id": "VideoGetItem"}' http://127.0.0.1:58080/jsonrpc > curl.txt

    % Total % Received % Xferd Average Speed Time Time Time Current

    Dload Upload Total Spent Left Speed

    100 124 0 0 100 124 0 41333 --:--:-- --:--:-- --:--:-- 62000

    MyPI:~/.config #

    MyPI:~/.config # more curl.txt

    MyPI:~/.config #

    Any ideas what could be the problem?

    Dear All,

    I currently have a script that automatically runs after startup. It basically sleeps for 12 hours and then reboots. The problem I am having is that my PI is restarting while media is playing in Kodi. Is there any shell/terminal command that can check if Kodi is currently playing media?

    *Before you ask :) I need this script because for some reason I am having SMB issues. I have an external 2-bay HDD enclosure connected via USB and after startup I am able to access the drives from other PCs. Unfortunately, after some time the SMBs seem to slow down soooo badly, that is not even possible to read-write to the drives from another PC. The solution I am using is just rebooting my PI. This is a separate problem, and I am aware that there might be million different causes so for the time being, I am happy by rebooting (IF media is NOT playing)