This board is now closed. The Blackhole image ended in 2020. The board will remain available in Read Only Mode, so all the posts from the last 15+ years are not lost. We thank you for being part of the community for the last 15+ years. You can join the OpenBh board if you have not already done so at www.openbh.net.

Scripts' expert needed!

AlexWilMac

Moderator
Hi,
for reasons too long to explain, I'd like to add a line to the script that launches CI, Ncam_Ci.sh.
The line I'd like to add is a command to copy a file but it must be executed as the LAST action: it does simply something like (is not the actual command but it has the same structure):
cp /media/hdd/myfile /etc/enigma2

I also created a script that performs only this action, and it perfectly works but I haven't managed, yet, to add it to the Ncam_Ci.sh so that it could be launched along with the launch of C.I.
Wherever I tried (I believe I tried every positions!) the command is executed either too soon or never.
How can I do that? I post the Ncam_Ci.sh content:

#!/bin/sh

CAMNAME="Common Interface"

remove_tmp () {
rm -rf /tmp/*.info /tmp/*.tmp
}

case "$1" in
start)
echo "[SCRIPT] $1: $CAMNAME"
remove_tmp
ulimit -s 1024
exec start-stop-daemon -S -x /usr/bin/vucamd
;;
stop)
echo "[SCRIPT] $1: $CAMNAME"
remove_tmp
exec start-stop-daemon -K -R 2 -x /usr/bin/vucamd
;;
*)
$0 stop
exit 0
;;
esac

exit 0
 
Back
Top