Code: Select all
[ ! -e /mtd_rwcommon/widgets/normal/MyWidget ] && cp -rf /dtv/usb/sda1/MyWidget /mtd_rwcommon/widgets/normal
Code: Select all
[ ! -e /mtd_rwcommon/widgets/normal/MyWidget ] && cp -rf /dtv/usb/sda1/MyWidget /mtd_rwcommon/widgets/normal
As always It works like a charm.Thank you so much.zoelechat wrote:Add this line just before injection:If I understood correctlyCode: Select all
[ ! -e /mtd_rwcommon/widgets/normal/MyWidget ] && cp -rf /dtv/usb/sda1/MyWidget /mtd_rwcommon/widgets/normal
I use following script as init script with this name:99_99_RunWidget.initzoelechat wrote:Add this line just before injection:If I understood correctlyCode: Select all
[ ! -e /mtd_rwcommon/widgets/normal/MyWidget ] && cp -rf /dtv/usb/sda1/MyWidget /mtd_rwcommon/widgets/normal
Code: Select all
. /dtv/SGO.env
OPTIONS=""
SODIR=$SYSROOT/opt/privateer/usr/libso # D/E only, on F/H environment LIBSO_DIR is used
SAMYGOSODIR=/mnt/opt/privateer/usr/bin
stop_bootloop()
{
for USB in /dtv/usb/sd* ; do
echo "checking $USB"
[ -e $USB/STOP ] && echo "STOP found. Script exit..." && exit 1
done
}
case $1 in
start)
stop_bootloop
[ "$LIBSO_DIR" ] && SODIR=$LIBSO_DIR
if [ -d /mtd_rwcommon/widgets/user/MyWidget ] ; then
samyGOso -A -B -l $SODIR/libRunWidget.so ID:MyWidget
else
$SAMYGOSODIR/samyGOso -A -B -l $SODIR/libAlert.so SYSTEM:"Installing..."
cp -rf /dtv/usb/sda1/MyWidget/MyWidget /mtd_rwcommon/widgets/user
$SAMYGOSODIR/samyGOso -A -B -l $SODIR/libAlert.so SYSTEM:"Rebooting..."
sleep 6
micom reboot
fi
;;
stop)
;;
status)
[ -f /dtv/RunWidget.log ] && cat /dtv/RunWidget.log || echo "Not started"
;;
*)
echo "Usage: $0 {start|stop|status}" 1>&2
exit 0
;;
esac
Code: Select all
#!/bin/sh
I intentionally remove '#!/bin/sh' from beginning of init script, because I want to make it more readable here in forum.zoelechat wrote:What aboutat the beginning of script?Code: Select all
#!/bin/sh
) my script run successfully and CP works great!Although script will run successfully during TV start up process and all files and directories of widget from USB copied to my expected folder, but all files size are 0 bytes!!!
What do you mean? You mean I have to use another CP command? Please explain.juuso wrote:Or /bin/busybox cp OR /mnt/bin/busybox cp
TV owns a limited busybox. SamyGO owns 2 more, that's why you could try to force you script to use one of them. I'd say most likely:smart_lover wrote:What do you mean? You mean I have to use another CP command? Please explain.juuso wrote:Or /bin/busybox cp OR /mnt/bin/busybox cp
Code: Select all
/mnt/bin/busybox cp
Code: Select all
/mnt/bin/busybox2 cp
Thanks, And what about this:zoelechat wrote:TV owns a limited busybox. SamyGO owns 2 more, that's why you could try to force you script to use one of them. I'd say most likely:smart_lover wrote:What do you mean? You mean I have to use another CP command? Please explain.juuso wrote:Or /bin/busybox cp OR /mnt/bin/busybox cporCode: Select all
/mnt/bin/busybox cp
Code: Select all
/mnt/bin/busybox2 cp
Precisely because environment (->PATH) might not be exactly the same whether you're in-Telnet or in-Script, and possibly the "wrong" cp is used if no path specifiedsmart_lover wrote:Whenever I run manually CP command that exists in init script( I mean 'cp -rf /dtv/usb/sda1/MyWidget/MyWidget /mtd_rwcommon/widgets/user'). It works well and my file contents copy also successfully. But my problem is when the init script wants to run above CP command.