summaryrefslogtreecommitdiff
path: root/navit/startonce.sh
diff options
context:
space:
mode:
Diffstat (limited to 'navit/startonce.sh')
-rwxr-xr-xnavit/startonce.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/navit/startonce.sh b/navit/startonce.sh
index d0bfafdcc..3e27d77f0 100755
--- a/navit/startonce.sh
+++ b/navit/startonce.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
# This script is part of navit, a navigation system.
# It can be used to make sure that navit is only started
@@ -22,7 +22,7 @@ NAVIT="./navit"
function check_wmctrl()
{
which wmctrl > /dev/null
-
+
if [ $? -ne 0 ] ; then
echo "I need the 'wmctrl' program. Exit."
exit 1
@@ -33,7 +33,7 @@ function start_navit()
{
if [ "x" != "x$CONFIG" ] ; then
$NAVIT -c $CONFIG &
- else
+ else
$NAVIT &
fi
@@ -58,12 +58,12 @@ function start_navit()
function check_navit()
{
if [ -f $PIDFILE ] ; then
- pid=`cat $PIDFILE`
+ pid=$(cat $PIDFILE)
kill -0 $pid 2>/dev/null
if [ $? -eq 0 ] ; then
echo "Bringing Navit to front"
- winid=`wmctrl -l -p | grep -e "^[^:blank:]*[:blank:]*[^:blank:]*[:blank:]*$pid[:blank:]*" | sed 's/ .*//'`
+ winid=$(wmctrl -l -p | grep -e "^[^:blank:]*[:blank:]*[^:blank:]*[:blank:]*$pid[:blank:]*" | sed 's/ .*//')
wmctrl -i -R $winid
exit 0