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
 
Top