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
    1. chmod 755 /etc/init.d/myscript.sh
    2. 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
    1. 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

    Shell-Script
    1. #!/bin/sh
    2. 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 :(

  • 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

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


    so it is better to use enigma2-plugin-systemplugins-startupservice to zap with enigma2 ;)

  • 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

    Shell-Script
    1. #!/bin/sh
    2. zap () {
    3. #wait a minute
    4. sleep 60
    5. wget -q -O - http://localhost/web/zap?sRef=1:0:1:3:3de:110:820000:0:0:0:
    6. }
    7. zap &
    8. exit 0


    this will delay the enimga2 start for 1 minute

    Shell-Script
    1. #!/bin/sh
    2. sleep 60
    3. wget -q -O - http://localhost/web/zap?sRef=1:0:1:3:3de:110:820000:0:0:0:
    4. 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

  • 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