Mercurial > trustbridge
annotate ui/trustbridge-tray-starter.sh @ 1332:8362e30f7b55
(issue139) Check that pid is not running if the lock can be aquired
If the lock on the lockfile can be aquired it might still be
possible that another process is running. So we read the
pid from the lockfile and check if another process with the
same installation prefix as us is running.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 15 Oct 2014 14:19:46 +0200 |
parents | a974b61a5cce |
children |
rev | line source |
---|---|
738
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
1 #!/bin/bash |
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
2 |
1160
a974b61a5cce
(issue108) Add missing license headers
Andre Heinecke <andre.heinecke@intevation.de>
parents:
763
diff
changeset
|
3 # Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik |
a974b61a5cce
(issue108) Add missing license headers
Andre Heinecke <andre.heinecke@intevation.de>
parents:
763
diff
changeset
|
4 # Software engineering by Intevation GmbH |
a974b61a5cce
(issue108) Add missing license headers
Andre Heinecke <andre.heinecke@intevation.de>
parents:
763
diff
changeset
|
5 # |
a974b61a5cce
(issue108) Add missing license headers
Andre Heinecke <andre.heinecke@intevation.de>
parents:
763
diff
changeset
|
6 # This file is Free Software under the GNU GPL (v>=2) |
a974b61a5cce
(issue108) Add missing license headers
Andre Heinecke <andre.heinecke@intevation.de>
parents:
763
diff
changeset
|
7 # and comes with ABSOLUTELY NO WARRANTY! |
a974b61a5cce
(issue108) Add missing license headers
Andre Heinecke <andre.heinecke@intevation.de>
parents:
763
diff
changeset
|
8 # See LICENSE.txt for details. |
a974b61a5cce
(issue108) Add missing license headers
Andre Heinecke <andre.heinecke@intevation.de>
parents:
763
diff
changeset
|
9 |
738
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
10 PREFIX="" |
763
654a8ca9d5b4
Set config dir used by trustbridge-tray-starter at runtime.
Sascha Wilde <wilde@intevation.de>
parents:
738
diff
changeset
|
11 CFGDIR="${XDG_CONFIG_HOME:-$HOME/.config}/BSI" |
738
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
12 TBCMD="trustbridge --tray" |
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
13 XSET=/usr/bin/xset |
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
14 CONFIG="$CFGDIR/trustbridge-tray-starter.cfg" |
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
15 |
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
16 if [ -r "$CONFIG" ] ; then |
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
17 DISPLAY=`sed -n "/DISPLAY/s/[^=]*=\(.*\)/\1/p" "$CONFIG"` |
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
18 export DISPLAY |
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
19 |
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
20 # only run when X is accessible |
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
21 if "$XSET" -q >/dev/null 2>&1 ; then |
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
22 "$PREFIX/bin/"$TBCMD |
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
23 fi |
ea8d13590cbd
Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
24 fi |