#!/bin/sh # # Copyright (c) 2003-2018, by Xinapse Systems, Ltd. # if [ ! -d /usr/local/bin ] then # /usr/local/bin not mounted exit fi unset DISPLAY # Start/stop the Dicom Server. case "$1" in start) # # Start the dicom server # if pgrep -x -u dicom DicomServer ; then echo "DicomServer already running. Restart it with: $0 restart" exit fi if [ -f /usr/local/bin/DicomServer ] ; then echo "Starting DicomServer." /bin/su dicom -c "/usr/local/bin/DicomServer &" # Wait for the server to come up. sleep 4 fi ;; restart) # # Restart the dicom server # # Stop it first. if pgrep -x -u dicom java ; then echo "Stopping DicomServer." pkill -9 -x -u dicom java >/dev/null 2>&1 fi # Restart it. if [ -f /usr/local/bin/DicomServer ] ; then echo "Starting DicomServer." /bin/su dicom -c "/usr/local/bin/DicomServer &" # Wait for the server to come up. sleep 4 fi ;; stop) if pgrep -x -u dicom java ; then echo "Stopping DicomServer." pkill -9 -x -u dicom java >/dev/null 2>&1 fi ;; *) echo "Usage: /etc/init.d/DicomServer { start | restart | stop }" ;; esac exit 0