Created
June 25, 2015 15:16
-
-
Save quiffman/9d873c5d0c4ce8e5c7fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# chkconfig: 345 99 01 | |
# | |
# description: SeisComP is seismological software package for data acquisition, | |
# processing, distribution and interactive analysis | |
# | |
script=/work/seiscomp3/bin/seiscomp | |
SC3USER=seiscomp | |
MODULE=$(basename $(readlink -f $0)) | |
if [ "$MODULE" = "seiscomp" ]; then | |
su - $SC3USER -c "$script $*" | |
else | |
command="$1" | |
shift | |
case "$command" in | |
status) | |
status=$(su - $SC3USER -c "$script status $MODULE") | |
echo -n "$status" | |
echo -n "$status" | grep -q 'is running' | |
;; | |
*) | |
su - $SC3USER -c "$script $command $MODULE $*" | |
;; | |
esac | |
fi | |
exit $? | |
# vim: set ts=4 sw=4 tw=0 et: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment