Page 3 of 4

Re: 22F5400 no telnet no VUSB and no remote working.

Posted: Sun Oct 02, 2016 11:19 am
by miazza
script is done with notepad ++.
attached.

Re: 22F5400 no telnet no VUSB and no remote working.

Posted: Sun Oct 02, 2016 1:20 pm
by juusso
Now place it inside /mnt/etc/init.d/ (overwrite your old script). Do sync.
chmod it

Code: Select all

chmod 755 /mnt/etc/init.d/*.init
and... maybe try to run with debug enabled:

Code: Select all

sh -x /mnt/etc/init.d/9999_9999_deleteLogs.init start
Give here the output...

p.s.s.. just came to my mind... Would be better to rename it to something like 01_01_ (or similar -need to think what number is better) to delete previuous log and leave logs of current TV run? At least for now check it "as is".

Re: 22F5400 no telnet no VUSB and no remote working.

Posted: Sun Oct 02, 2016 4:05 pm
by miazza

Code: Select all

VDLinux#> sh -x /mnt/etc/init.d/9999_9999_deleteLogs.init start
+ . /dtv/SGO.env
'mnt/etc/init.d/9999_9999_deleteLogs.init: .: line 1: can't open '/dtv/SGO.env
VDLinux#>

Re: 22F5400 no telnet no VUSB and no remote working.

Posted: Sun Oct 02, 2016 6:19 pm
by juusso
Remove or comment out this line from script and try again

Code: Select all

# . /dtv/SGO.env

Re: 22F5400 no telnet no VUSB and no remote working.

Posted: Tue Oct 04, 2016 6:32 am
by miazza

Code: Select all

VDLinux#> sh -x /mnt/etc/init.d/99_99_deleteLogs.init start
+
: not foundit.d/99_99_deleteLogs.init: line 1:
/mnt/etc/init.d/99_99_deleteLogs.init: line 8: syntax error: unexpected word (expecting "in")
VDLinux#>

Re: 22F5400 no telnet no VUSB and no remote working.

Posted: Tue Oct 04, 2016 8:55 am
by juusso
very and very weird errors! Indeed must think how to do some work arround...:
replace the loop (everything between Start) and ;; to :

Code: Select all

maxsize=120000 # adjust filesize here
file = "/mnt/samygo.log"
         actualsize=$(wc -c <"$file")
            if [ $actualsize -ge $maxsize ]; then
               rm -f $file
            fi
file = "/mnt/sam.log"
         actualsize=$(wc -c <"$file")
            if [ $actualsize -ge $maxsize ]; then
               rm -f $file
            fi

Re: 22F5400 no telnet no VUSB and no remote working.

Posted: Tue Oct 04, 2016 9:16 am
by zoelechat
miazza wrote:

Code: Select all

 .: line 1: can't open '/dtv/SGO.env
Really looks like bad linefeeds imho, "using Notepad++" is not enough, you also have to set linefeeds to unix format into menu :)

Re: 22F5400 no telnet no VUSB and no remote working.

Posted: Tue Oct 04, 2016 9:33 am
by juusso
no need for sgo.env, we dont use any global variables here. We just delete two certain files.
However, i`m in doubts where is problem with "in" (script worked on my "test" setup w/o any problem).

Re: 22F5400 no telnet no VUSB and no remote working.

Posted: Tue Oct 04, 2016 6:26 pm
by miazza
The script now look like that:

Code: Select all

#!/bin/sh
#
# ? Copyright 1996-2016, SamyGO
#
# 
# . /dtv/SGO.env

case $1 in
   start)
      maxsize=120000 # adjust filesize here
file = "/mnt/samygo.log"
         actualsize=$(wc -c <"$file")
            if [ $actualsize -ge $maxsize ]; then
               rm -f $file
            fi
file = "/mnt/sam.log"
         actualsize=$(wc -c <"$file")
            if [ $actualsize -ge $maxsize ]; then
               rm -f $file
            fi
   ;;
   *)
   echo "Usage: $0 {start}" 1>&2
   exit 0
   ;;
esac
The error is:

Code: Select all

VDLinux#> sh -x /mnt/etc/init.d/99_99_deleteLogs.init start
+
: not foundit.d/99_99_deleteLogs.init: line 1:
/mnt/etc/init.d/99_99_deleteLogs.init: line 8: syntax error: unexpected word (expecting "in")
VDLinux#>


Re: 22F5400 no telnet no VUSB and no remote working.

Posted: Tue Oct 04, 2016 7:36 pm
by juusso
And other scripts are ok? weird. It complains about basic structure of init script. Don`t get where is the problem.