Skip to content

Instantly share code, notes, and snippets.

@quiffman
Created June 25, 2015 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quiffman/9d873c5d0c4ce8e5c7fb to your computer and use it in GitHub Desktop.
Save quiffman/9d873c5d0c4ce8e5c7fb to your computer and use it in GitHub Desktop.
#!/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