#!/bin/bash
NAME=openrc-settingsd
host=$(hostname -s)
start() {
echo "Starting Openrc-Settingsd Services: "
        /usr/libexec/$NAME --syslog > /dev/null 2>&1 &
}

stop() {
echo "Stopping Openrc-Settingsd Services: "
#Find the Process ID for openrc-settingsd running instance
ps -ef | grep openrc-settingsd | grep -v grep | awk '{print $2}' | xargs kill
}

restart() {
  stop
  sleep 3
  start
}

case "$1" in
    start)   start ;;
    stop)    stop ;;
    restart) stop; start ;;
    *) echo "usage: $0 start|stop|restart" >&2
       exit 1
       ;;
esac