Browse files

""

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@91 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent 0d7291a commit c4ab5ce0b52dbd089aa7812449ff93bcfde18ba2 @klacke committed Jun 16, 2002
Showing with 78 additions and 0 deletions.
  1. +78 −0 scripts/yaws.init.d
View
78 scripts/yaws.init.d
@@ -0,0 +1,78 @@
+#!/bin/bash
+#
+# Startup script for the Yaws Web Server
+#
+# config: /etc/yaws.conf
+
+# Source function library.
+
+. /etc/rc.d/init.d/functions
+
+yaws=/usr/local/bin/yaws
+prog=yaws
+
+start() {
+ echo -n $"Starting $prog: "
+ daemon $yaws -D
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && touch /var/lock/subsys/yaws
+ return $RETVAL
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ str=`$yaws -s`
+ if [ "$str" = "stopping" ]; then
+ echo_success
+ RETVAL=0
+ else
+ echo_failure
+ RETVAL=1
+ fi
+ echo
+ rm -f /var/lock/subsys/yaws /var/run/yaws.pid
+}
+
+
+reload() {
+ echo -n $"Reloading $prog: "
+ r=`$yaws -h`
+ RETVAL=$?
+ echo $r
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ $yaws -S
+ RETVAL=$?
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ condrestart)
+ if [ -f /tmp/yaws.ctl ] ; then
+ stop
+ start
+ fi
+ ;;
+ reload)
+ reload
+ ;;
+ help)
+ $yaws -?
+ ;;
+ *)
+ echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|help}"
+ exit 1
+esac
+
+exit $RETVAL

0 comments on commit c4ab5ce

Please sign in to comment.