#!/bin/sh

if [ ! -x /usr/bin/dbus-daemon ]
then
    exit 0
fi

if [ "$1" = "stop" -o "$1" = "restart" ]
then                                                                            
    echo "Stopping dbus system daemon: "
    killall -q /usr/bin/dbus-daemon
    rm -f /tmp/run/dbus/*
fi

if [ "$1" = "start" -o "$1" = "restart" ]                                       
then
    echo "Starting dbus system daemon: "
    /usr/bin/dbus-daemon --system
fi
