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?
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?
self created /etc/rc3.d/S90UserInit works well
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:
do not forget the last dot
the "-v" is for verbose output.
For stopping the scripts start at boot give in telnet the command
again, "-v" is for verbose output while "-f" is to force the removal.
self created /etc/rc3.d/S90UserInit works well
/etc/rc3.d/S90channel.sh creaeted chmod 755
Zitat#!/bin/sh
wget -q -O - http://localhost/web/zap?sRef=1:0:1:3:3de:110:820000:0:0:0:
unfortunately it does not work
I think you should take a look at the plugin "Startup Service"
added /etc/init.d/S90channel.sh , chmod 755
ZitatAlles anzeigenroot@dm7020hd:~# update-rc.d -v S90channel.sh start 99 3 . stop 99 6 .
Adding system startup for /etc/init.d/S90channel.sh.
/etc/rc3.d/S99S90channel.sh -> ../init.d/S90channel.sh
/etc/rc6.d/K99S90channel.sh -> ../init.d/S90channel.sh
root@dm7020hd:~#
Broadcast message from root@dm7020hd (console) (Tue Dec 10 14:34:46 2013):
The system is going down for reboot NOW!
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
#!/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
Alles anzeigen
this will delay the enimga2 start for 1 minute
#!/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
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 startBash#!/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
how to name the script, how to start it automatically
This is just one example ( zap channel)
Finally I managed to make the script work
thanks to all and especially to ni_hao and Fred Bogus Trumper
Hi this worked well in 0E2.0 but it is not launching my script in 0E2.6 DE. Any help please?
use a systemd service
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
#!/bin/sh -e
# will be executed by systemd (rc-local.service) at startup
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 () {
#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
Alles anzeigen
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: