Skip to content

Instantly share code, notes, and snippets.

@RVIRUS0817

RVIRUS0817/h2o

Last active Apr 6, 2017
Embed
What would you like to do?
init script
#!/bin/bash
#chkconfig: 2345 85 15
#descpriction: h2o Web Server
# source function library
. /etc/rc.d/init.d/functions
RETVAL=0
SERVICE_NAME=`basename $0`
rh_status() {
status -p ${pidfile} -b ${h2o} ${h2o}
}
start() {
echo -n $"Starting : $SERVICE_NAME"
/etc/h2o/h2o -c /etc/h2o/h2o.conf &
RETVAL=$?
if [ $RETVAL == 0 ]; then
success
else
failure
fi
echo
}
stop() {
echo -n $"Stopping $SERVICE_NAME: "
pkill h2o
RETVAL=$?
if [ $RETVAL == 0 ]; then
success
else
failure
fi
echo
}
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
esac
exit $RETVAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment