How run an ownmade script at boot

This is general talk area for things that NOT RELATED WITH TV! Instead, about internal works like web site, forum, wiki, or talking, etc...

User avatar
3iOnDo
SamyGO Project Donor
Posts: 28
Joined: Sun Apr 20, 2014 7:19 pm
Location: Italy

How run an ownmade script at boot

Post by 3iOnDo » Sun Sep 20, 2015 1:19 pm

Hi all,
i've made a stupid script for clean .log file created by oscam.
If i run it via terminal, it works, but i've put a file in /mnt/etc/init.d/99_99_clean.init

#!/bin/sh
. /mnt/opt/privateer/usr/bin/oscam/clean


and won't work.

Permissions are right

Probably i don't get an obvious thing (i'm not a programmer, i'm just trying to learn how scripts work and how use 'em)

Can you give me a help ?
UE32F6400 - T-MST12DEUC-1119.0,BT-G - SamyGO Extensions on F series

" I don't know ... for now ... "

User avatar
juusso
SamyGO Moderator
Posts: 10011
Joined: Sun Mar 07, 2010 6:20 pm

Re: How run an ownmade script at boot

Post by juusso » Sun Sep 20, 2015 1:34 pm

Pay attention to script structure and arguments. Check other scripts and get selfinformed...

case $1 in
start)
Your code here
;;

esac
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE

User avatar
3iOnDo
SamyGO Project Donor
Posts: 28
Joined: Sun Apr 20, 2014 7:19 pm
Location: Italy

Re: How run an ownmade script at boot

Post by 3iOnDo » Sun Sep 20, 2015 1:38 pm

Thank juusso for reply

So

#!/bin/sh

case $1 in
start)
. /mnt/opt/privateer/usr/bin/oscam/clean
;;

esac


Also is there a wiki about init priority (01_01 will be execute before 99_99 ?) ?
Because i need to delete log before oscam starts.
I remember that i saw something about it, but i think it was a talk in a thread and not a thread ...

Thank you so much
UE32F6400 - T-MST12DEUC-1119.0,BT-G - SamyGO Extensions on F series

" I don't know ... for now ... "

zoelechat
Official SamyGO Developer
Posts: 8300
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: How run an ownmade script at boot

Post by zoelechat » Sun Sep 20, 2015 2:44 pm

Hex edit libOscam.so and change /dtv/libOscam.log to /dev/null
No more log :)
I do NOT receive any PM. Please use forum.

User avatar
3iOnDo
SamyGO Project Donor
Posts: 28
Joined: Sun Apr 20, 2014 7:19 pm
Location: Italy

Re: How run an ownmade script at boot

Post by 3iOnDo » Sun Sep 20, 2015 3:04 pm

Thanks zoe, :D

but i'm trying to launch a script from init.d

just to try

that's why i haven't use your solution yet

clear a log file script it's easy to do for my (un)knowledge.

Via terminal works, but i can't do it on boot.

last try is

Code: Select all

#!/bin/sh

 . /dtv/SGO.env

case $1 in 
	start)
	/mnt/opt/privateer/usr/bin/oscam/clean
        ;;

esac
[/b]

Is it so hard to achieve ?
UE32F6400 - T-MST12DEUC-1119.0,BT-G - SamyGO Extensions on F series

" I don't know ... for now ... "

zoelechat
Official SamyGO Developer
Posts: 8300
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: How run an ownmade script at boot

Post by zoelechat » Sun Sep 20, 2015 3:10 pm

Are you using Notepad++ with linefeeds set to Unix Format (LF)? :)
I do NOT receive any PM. Please use forum.

User avatar
3iOnDo
SamyGO Project Donor
Posts: 28
Joined: Sun Apr 20, 2014 7:19 pm
Location: Italy

Re: How run an ownmade script at boot

Post by 3iOnDo » Sun Sep 20, 2015 3:15 pm

zoelechat wrote:Are you using Notepad++ with linefeeds set to Unix Format (LF)? :)
No, Text Edit with make plain text option (osx).

Usually it works when edited some samyscripts (i've modded "oscam started" in "oscaaaaam" and worked).

Is it in correct form ? Should it works ?

i can try notepad++ if it can be the problem.
UE32F6400 - T-MST12DEUC-1119.0,BT-G - SamyGO Extensions on F series

" I don't know ... for now ... "

zoelechat
Official SamyGO Developer
Posts: 8300
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: How run an ownmade script at boot

Post by zoelechat » Sun Sep 20, 2015 3:20 pm

It depends, if you edit an existing script it will keep its linefeed type, but if you start one from scratch it might be different/wrong default...
Just to be sure you can launch your startup script manually and give output:

Code: Select all

sh -x /mnt/etc/init.d/99_99_clean.init start
I do NOT receive any PM. Please use forum.

User avatar
3iOnDo
SamyGO Project Donor
Posts: 28
Joined: Sun Apr 20, 2014 7:19 pm
Location: Italy

Re: How run an ownmade script at boot

Post by 3iOnDo » Sun Sep 20, 2015 3:25 pm

SpoilerShow
VDLinux#> sh -x /mnt/etc/init.d/99_99_clean.init start
+ . /dtv/SGO.env
+ SYSROOT=/mnt
+ MOUNT_PATH=/dtv/usb/sdb
+ export USER_FIRMWARE=MST12
+ export KMOD_VER=0116
+ export MOD_DIR=/mnt/lib/modules/3.0.33
+ export TMPDIR=/dtv
+ export HOME=/mtd_rwcommon
+ export SMB_CONF_PATH=/mnt/etc/samba/smb.conf
+ LOGFILE=/mnt/samygo.log
+ LD_LIBRARY_PATH=/mnt/opt/privateer/lib:/mnt/opt/privateer/usr/lib:/mnt/lib:/mnt/usr/lib:/tmp/bin:/mtd_cmmlib/RECOGNITION_LIB:/lib:/mtd_cmmlib/lib:/mtd_cmmlib/Comp_LIB:/mtd_exe/lib:/mtd_cmmlib/YWidget_LIB:/mtd_cmmlib/InfoLink/lib/plugin/Static:/mtd_appdata/moip:/mtd_cmmlib/GAME_LIB:/mtd_appdata/gemstar:/mtd_cmmlib/DRM_LIB:/Java/lib:/mtd_cmmlib/InfoLink/lib:/mtd_appext/WidgetEngine:/mtd_appext/Webkit:/mtd_exe/WebServerApp/bin:/mtd_cmmlib/CBRE:/mtd_cmmlib/CBRE/bin/lib:/mtd_cmmlib/flashplayer/libs:/mtd_appdata/Runtime/lib/CairoShadow:/mtd_appdata/Runtime/lib:/mtd_appdata/Runtime/XorgLibs:/mtd_cmmlib/CM_LIB:/mtd_appext/OIPF/lib:/mtd_exe/OIPF/lib:/mtd_contents:/dtv
+ PATH=/mnt/opt/privateer/sbin:/mnt/opt/privateer/bin:/mnt/opt/privateer/usr/bin:/mnt/opt/privateer/usr/sbin:/mnt/sbin:/mnt/bin:/mnt/usr/bin:/mnt/usr/sbin:/tmp/bin:/usr/sbin:/usr/bin:/bin:/sbin:/etc/Scripts:/util:/mtd_appdata/Runtime/bin
+ export ENV=/dtv/.ashrc
+ export FRAMEBUFFER=/dev/sam/fb0
+ export DISTROOT=/mnt/opt/privateer
+ export LIBSO_DIR=/mnt/opt/privateer/usr/libso
+ export TERM=linux
+ export LS_OPTIONS=--color=auto
+ export TZ=GMT-2
+ /mnt/opt/privateer/usr/bin/oscam/clean
UE32F6400 - T-MST12DEUC-1119.0,BT-G - SamyGO Extensions on F series

" I don't know ... for now ... "

zoelechat
Official SamyGO Developer
Posts: 8300
Joined: Fri Apr 12, 2013 7:32 pm
Location: France

Re: How run an ownmade script at boot

Post by zoelechat » Sun Sep 20, 2015 3:30 pm

Seems good, problem must be with /mnt/opt/privateer/usr/bin/oscam/clean then :)
Are you sure of permissions? (the ones of /mnt/etc/init.d/99_99_clean.init I mean)
I do NOT receive any PM. Please use forum.

Post Reply

Return to “General”