#!/bin/sh
# start dontpanic as single user or the server

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

PYTHON=$(which python)
if [ $? -ne 0 ]; then
    PYTHON=$(which python)
fi
if [ -d /usr/share/dontpanic ]; then
    cd /usr/share/dontpanic
elif [ -d ./src ]; then
    cd src
fi

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