dontpanic 438 Bytes
Newer Older
Thuban's avatar
Thuban committed
1
#!/bin/sh
Thuban's avatar
Thuban committed
2
# start dontpanic as single user or the server
3 4 5 6

# move into script dir
cd "$(dirname $0)"

Thuban's avatar
Thuban committed
7
PYTHON=$(which python3.4)
Thuban's avatar
Thuban committed
8
if [ $? -ne 0 ]; then
Thuban's avatar
Thuban committed
9 10
    PYTHON=$(which python3)
fi
Thuban's avatar
Thuban committed
11 12
if [ -d /usr/share/dontpanic ]; then
    cd /usr/share/dontpanic
Thuban's avatar
Thuban committed
13 14
elif [ -d ./src ]; then
    cd src
Thuban's avatar
Thuban committed
15 16 17 18 19 20 21 22
fi

if [ -e ./dontpanic.py ]; then
    if [ $# -le 1 ]; then
        $PYTHON dontpanic.py $1
    else
        $PYTHON dontpanic-server.py $@
    fi
23 24
fi
exit 0