#!/bin/sh

if [ -z $USERNAME ]; then
    SOCK="/tmp/darxsock.$USER"
else
    SOCK="/tmp/darxsock.$USERNAME"
fi

if [ -S $SOCK ]; then
    if `echo "Test" >$SOCK`; then
        echo "The Darxite daemon is running OK"
    else
        echo "The Darxite daemon is not running, but the socket is present"
    fi
else
    echo "The Darxite daemon is not running"
fi
