Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@netman-iqq ~]# cat /etc/init.d/smokeping
- #!/bin/bash
- #
- # chkconfig: 2345 80 05
- # Description: Smokeping init.d script
- # Get function from functions library
- . /etc/init.d/functions
- # Start the service Smokeping
- start() {
- echo -n "Starting Smokeping: "
- /opt/smokeping/bin/smokeping --debug-daemon > /dev/null 2>&1
- ### Create the lock file ###
- touch /var/lock/subsys/smokeping
- success $"Smokeping startup"
- echo
- }
- # Restart the service Smokeping
- stop() {
- echo -n "Stopping Smokeping: "
- kill -9 `ps ax | grep "/opt/smokeping/bin/smokeping" | grep -v grep | awk '{ print $1 }'` >/dev/null 2>&1 && killall speedy_backend
- ### Now, delete the lock file ###
- rm -f /var/lock/subsys/smokeping
- success $"Smokeping shutdown"
- echo
- }
- ### main logic ###
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- status)
- status Smokeping
- ;;
- restart|reload|condrestart)
- stop
- start
- ;;
- *)
- echo $"Usage: $0 {start|stop|restart|reload|status}"
- exit 1
- esac
- exit 0
Add Comment
Please, Sign In to add comment