Autostart script OE2.0

  • How to have a script that starts automatically when you boot your box


    With Nemesis OE1.6 was necessary to nominate S99Script_Start.sh and place it in the folder /etc/rc3.d


    With OE2.0 how I make this?

  • assuming the script name is: myscript.sh and you will use S99 and K99


    - copy myscript.sh to /etc/init.d
    in telnet give the commands:


    Code
    chmod 755 /etc/init.d/myscript.sh
    update-rc.d -v myscript.sh start 99 3 . stop 99 6 .


    do not forget the last dot
    the "-v" is for verbose output.


    For stopping the scripts start at boot give in telnet the command

    Code
    update-rc.d -v -f myscript.sh remove

    again, "-v" is for verbose output while "-f" is to force the removal.

  • added /etc/init.d/S90channel.sh , chmod 755

    Bash
    #!/bin/sh
    wget -q -O - http://localhost/web/zap?sRef=1:0:1:3:3de:110:820000:0:0:0:


    I'm sorry it does not work :frowning_face:

  • becouse the init.d script will be executed before enigma2 is completly started and the webinterface is not available ..


    try this instead, the 'sleep 60' in the function 'zap' (started in backgroud subshell) will do not delay the enigma2 start



    this will delay the enimga2 start for 1 minute

    Bash
    #!/bin/sh
    sleep 60  
    wget -q -O - http://localhost/web/zap?sRef=1:0:1:3:3de:110:820000:0:0:0:
    
    
    exit 0


    so it is better to use enigma2-plugin-systemplugins-startupservice to zap with enigma2 :winking_face:

    Gruß Fred

    Die Dreambox ist tot, es lebe die Dreambox

    Einmal editiert, zuletzt von Fred Bogus Trumper ()

  • becouse the init.d script will be executed before enigma2 is completly started and the webinterface is not available ..
    try this instead, the 'sleep 60' in the function 'zap' (started in backgroud subshell) will do not delay the enigma2 start

    Bash
    #!/bin/sh
    zap () {
    #wait a minute
    sleep 60  
    wget -q -O - http://localhost/web/zap?sRef=1:0:1:3:3de:110:820000:0:0:0:
    }
    zap &
    exit 0


    this will delay the enimga2 start for 1 minute

    Bash
    #!/bin/sh
    sleep 60  
    wget -q -O - http://localhost/web/zap?sRef=1:0:1:3:3de:110:820000:0:0:0:
    exit 0

    how to name the script, how to start it automatically


    This is just one example ( zap channel)

  • read instructions from ni_hao, any name of script
    to test add into script line
    echo `date +%Y.%m.%d.\ %H:%M:%S`" $0 $1 $2">>/tmp/myscript_start_stop.log


    and then check content of /tmp/myscript_start_stop.log after bootup

  • it's possible to place the script in /etc/rc.local. If this file does not exist you have to create it


    touch /etc/rc.local

    chmod 755 /etc/rc.local


    /etc/rc.local

    please note, that the security settings have to be disabled in the webinterface settings - if enabled this srcipt will not work

    Gruß Fred

    Die Dreambox ist tot, es lebe die Dreambox

  • worked well in 0E2.0 but it is not launching my script in 0E2.6 DE. Any help please?

    few useful posts about required changes in the scripts:

    enigma2 Webinterface API Documentation