-
-
Save attozk/9a1f3acf92f421599d4b to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# /etc/init.d/owpd | |
# | |
# chkconfig: 2345 85 15 | |
# description: OWP Daemon | |
# processname: OWP Daemon | |
# | |
# Install the service with chkconfig --add owpd | |
# | |
# Define where owp is installed. | |
# The trailing slash is required ( Example : /my/path/bin/ ) | |
OWP_DIRECTORY=/opt/ovz-web-panel/utils/hw-daemon/ | |
# Source function library. | |
. /etc/init.d/functions | |
DAEMON="${OWP_DIRECTORY}hw-daemon.rb" | |
start() { | |
cd $OWP_DIRECTORY; | |
ruby $DAEMON start | |
RETVAL=$? | |
echo | |
[ $RETVAL = 0 ] && touch /var/lock/subsys/owpd | |
return $RETVAL | |
} | |
stop() { | |
echo "Stopping OVZ Web Panel Daemon..." | |
ruby $DAEMON stop | |
RETVAL=$? | |
echo | |
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/owpd | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
stop | |
start | |
;; | |
*) | |
echo "Usage: {start|stop|restart}" | |
exit 1 | |
;; | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment