I want to call some application from script. I use an application which doesn't allow any parameters in CLI but I need to test it in two different monitors and screen resolutions so I have two different configuration files. To call needed version I use simple script (name it notebook.sh
):
#!/bin/sh
rm /home/user/.app/config.ini
cp /home/user/.app/config.ini.1366x768 /home/user/.app/config.ini
sleep 1
/usr/local/bin/app &
or second version with cp
line changed.
OK, it's simple. But when I quit this app (Ctrl+Q built-in function) it still runs. Calling ps
command I see app
and notebook.sh
in processes list.
My question is: how should notebook.sh
script be written to terminate/kill app
and script totally? Something like this piece of code:
if [ "$1" = "start" ]; then /usr/bin/mplayer -fs -osdlevel 0 $2 ; fi
if [ "$1" = "stop" ]; then killall mplayer ; fi