Sha256: 3bf4eb94e86f625773fe65c3be6aa7b315950f2a7c9b36bd9dbdb665d9306140

Contents?: true

Size: 908 Bytes

Versions: 5

Compression:

Stored size: 908 Bytes

Contents

#! /bin/sh

### BEGIN INIT INFO
# Provides:		   sfpagent
# Required-Start:	
# Required-Stop:	
# Default-Start:	2 3 4 5
# Default-Stop:		
# Short-Description:	SFP Agent Daemon
### END INIT INFO

set -e

bin="/home/herry/workspace/sfp/sfpagent/bin/sfpagent"

test -x $bin || exit 0

umask 022

. /lib/lsb/init-functions

if [ `/usr/bin/id -u` != "0" ]; then
  log_daemon_msg "Error: must be run with root"
  exit 1
fi

export PATH="${PATH:+$PATH:}/usr/sbin:/sbin:/usr/local/bin"

case "$1" in
  start)
	log_daemon_msg "Starting SFP Agent daemon" "sfpagent" || true
   $bin -s
	;;
  stop)
	log_daemon_msg "Stopping SFP Agent daemon" "sfpagent" || true
   $bin -t
	;;
  restart)
	log_daemon_msg "Restarting SFP Agent daemon" "sfpagent" || true
   $bin -r
	;;
  status)
	$bin -a && exit 0 || exit $?
	;;

  *)
	log_action_msg "Usage: /etc/init.d/sfpagent {start|stop|restart|status}" || true
	exit 1
esac

exit 0

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sfpagent-0.2.9 bin/init_script
sfpagent-0.2.8 bin/init_script
sfpagent-0.2.7 bin/init_script
sfpagent-0.2.6 bin/init_script
sfpagent-0.2.5 bin/init_script