This is a nice problem:
- i want to have a program with UI-buttons that performs the following:
(1) if i press a button to "ON" it activates a shell script
(2) if i press a button to "OFF" it kills this shell script
(3) if the shell script terminates (OR gets killed by anyone else),
the corresponding button in the program should go to "OFF"
and (last but not least)
(4) it should be possible to have multiple instances of this program that all have valid indicators for the corresponding scripts that run (or not)
The program CONTROL that has a button "Start Production"
I invoke this program CONTROL several times.
Selecting the button in one of the CONTROL apps, invokes the shell script "startprod" AND (!!!) it should lit all corresponding buttons "Start Production" in the other instances of CONTROL.
Then I manually kill this script.
Now all buttons should go to "OFF"...
Well, taking care of (1) and (2) is not so difficult: I have created an "in between script" that is called with 1 (button was pressed) or 0 (button was released) by the program CONTROL. The "inbetween script" kills or calls "startprod" (i store pid's in files).
But taking care of (3) and (4) is a bit more difficult... Any ideas?!?
Let's find out who the clever guys are here!!!