Download and extract

  • I have created a very simple script file:

    Bash
    #!/bin/bash
    wget -q http://www.vuplus-community.net/rytec/rytecxmltv-UK.gz -O /storage/autoepg/rytecxmltv-UK.gz
    cd /storage/autoepg
    gunzip -f /storage/autoepg/rytecxmltv-UK.gz

    It downloads okay. But when i run the script in putty (to test, I want to automate this everyday). It comes with the following messages:

    Code
    LibreELEC:~ # sh epg.sh
    epg.sh: cd: line 3: can't cd to /storage/autoepg
    gunzip: /storage/autoepg/rytecxmltv-UK.gz: No such file or directory

    What am i doing wrong?

  • thanks for the response

    by adding what you said and making the code like this:

    Bash
    #!/bin/bash
    /storage/autoepg
    wget -q http://www.vuplus-community.net/rytec/rytecxmltv-UK.gz -O /storage/autoepg/rytecxmltv-UK.gz
    cd /storage/autoepg
    gunzip -f /storage/autoepg/rytecxmltv-UK.gz

    I get the following:

    Code
    LibreELEC:~ # sh epg.sh
    : not founde 2: /storage/autoepg
    epg.sh: cd: line 4: can't cd to /storage/autoepg
    gunzip: /storage/autoepg/rytecxmltv-UK.gz: No such file or directory
  • Ah, type mistake. Try

    Bash
    #!/bin/sh
    mkdir -p /storage/autoepg
    cd /storage/autoepg
    wget -q http://www.vuplus-community.net/rytec/rytecxmltv-UK.gz -O rytecxmltv-UK.gz
    gunzip -f rytecxmltv-UK.gz

    Edited once, last by vpeter (December 25, 2016 at 1:55 PM).

  • thank you again:

    I seem to have narrowed the problem down. When creating the file, it is not saving it as "

    Code
    rytecxmltv-UK.gz


    but rather

    Code
    rytecxmltv-UK.gz?

    I don't know why that is i have tried multiple times to create a new file start from scratch, type it in etc. It doesn't seem to be working. When i manually go in, it just sppears to be a sapce in the file name at the end 'rytecxmltv-UK.gz '

    Further more, it still keeps saying no directory found when trying to gunzip.

    Perhaps you can send me the .sh file with this in it maybe windows doing something funny?

    Btw i have gone in manually made this file "executable" through properties of winscp. making it "777"

    Thanks

    Edited once, last by gopal (December 25, 2016 at 2:20 PM).

  • My christmas gift: rytec.sh

    Edited once, last by vpeter (December 25, 2016 at 3:29 PM).

  • ah thanks that worked.

    i think i know the problem now it was that i made it in windows and my eol was windows and not unix. thats probably the issue

    since you know your way around it, maybe u can help me out with this as part of extension of this.

    Every time kodi is started i want to run this script but only if the file is not equal to today's date.

    I am very new to bash any help would be great.

  • yh had a look at that and thats what i have been following but perhaps its working too quickly before netowrk is up

    (
    sh ~/autoepg/rytec.sh
    kodi-send
    --action="Notification(EPG,done,6000)"
    )

  • so would this be okay?

    (
    sleep 15
    sh ~/autoepg/rytec.sh
    kodi-send
    --action="Notification(EPG,done,6000)"
    )

    btw thats all of the contents of autostart.sh


    Sent from my SM-G935F using Tapatalk

  • tried it all it did was pause on the libreelec screen for 20 seconds and carried on its loading so no messages. unless it actually did it. i kind of want it to run after kodi gui has been loaded

    Edited once, last by gopal (December 27, 2016 at 10:18 AM).

  • You missed & character which puts whole block in background process:

    Code
    (
    sleep 15
    sh /storage/autoepg/rytec.sh
    kodi-send --action="Notification(EPG,done,6000)"
    )&
  • You've been a great help. Its no secret that this was for EPG so i have created a guide on the wetek forums (as thats the device i own) perhaps i can upload it here as well if required.