summaryrefslogtreecommitdiffstats
path: root/recipes-openivi/openivi-html5/openivi-html5/openivi-html5.sh
blob: 190ab653de5caa5ddd6cdc34c2725c2d3c4bd997 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

if test -z "$XDG_CONFIG_DIRS"; then
    export XDG_CONFIG_DIRS=/etc/xdg/
fi

if test -z "$XDG_RUNTIME_DIR"; then
    export XDG_RUNTIME_DIR=/run/user/$UID
    mkdir --parents $XDG_RUNTIME_DIR
    chmod 0700 $XDG_RUNTIME_DIR
fi

# Default homescreen
HOMESCREEN=/usr/share/openivi/example/cluster/index.html

# Read configuration
HOMESCREEN_CONFIG=$XDG_CONFIG_DIRS/openivi-html5/openivi-html5.ini
if [ -e "$HOMESCREEN_CONFIG" ] ; then
    HTML=`sed -n '/^homescreen=\(.*\)$/s//\1/p' <  $HOMESCREEN_CONFIG`
    if [ -e "$HTML" ] ; then
        HOMESCREEN=$HTML
    fi
fi

/usr/bin/openivi-html5 -f -u $HOMESCREEN