Ticket #79 (new defect)

Opened 18 months ago

Last modified 12 months ago

doing things only once

Reported by: wogri at wogri dot com Owned by: michael
Priority: normal Component: lcd4linux
Version: 0.1 Severity: minor
Keywords: Cc: wogri@…

Description

Hi,

I have the following scenario: once a key is pressed on my lcd display, an external command should be launched ONCE via exec(). it seems as if such evaluations don't work:

evaluation key == 2 ? exec ('start_something',3000) evaluation2 key == 2 ? key = 1 :

Any help would be appreciated!

Attachments

Change History

in reply to: ↑ description   Changed 12 months ago by anonymous

Replying to wogri at wogri dot com:

Hi, I have the following scenario: once a key is pressed on my lcd display, an external command should be launched ONCE via exec(). it seems as if such evaluations don't work: evaluation key == 2 ? exec ('start_something',3000) evaluation2 key == 2 ? key = 1 : Any help would be appreciated!

I had the same problem. I fixed it by executing a script, which tested, if the command is already running. If not, the script launches the command.
For example:
#!/bin/bash
id=0
id=ps ax | grep your_command | awk '{print $1}'
if [ $id -ge 0 ]

then
echo "Programm is already running"
else your_command

fi
exit 0

it's a quite simple solution. try it.

Add/Change #79 (doing things only once)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change. Next status will be 'new'
The owner will change to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.