Permalink
Browse files

NetBSD support from Kuzma Bartosz

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@997 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent 37a6db2 commit fabb01c6a792e320d8f4d4ce8cecc92bc79f4e33 @klacke committed Aug 7, 2006
Showing with 59 additions and 1 deletion.
  1. +3 −1 scripts/Install
  2. +56 −0 scripts/netbsd/yaws.sh
View
@@ -75,7 +75,9 @@ elif [ "`uname -s`" = "Darwin" -a `id -u` = 0 ]; then
chown -R root:wheel ${startupdir}
elif [ "`uname -s`" = "FreeBSD" ]; then
sed -e "s;%prefix%;$p;g" -e "s;%etcdir%;$e;g" freebsd/yaws.sh > ${destdir}/${etcdir}/rc.d/yaws.sh
-else
+elif [ "`uname -s`" = "NetBSD" ]; then
+ sed -e "s;%prefix%;$p;g" -e "s;%etcdir%;$e;g" netbsd/yaws.sh > /etc/rc.d/yaws
+else
install -d ${destdir}/${etcdir}
echo "Don't know how to make /etc/init scrips for this system"
echo "possibly add ${prefix}/bin/yaws --daemon --heart to your /etc/rc.local manually"
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+
+#
+# PROVIDE: yaws
+# REQUIRE: DAEMON
+#
+# You will need to set some variables in /etc/rc.conf to start Yaws:
+#
+# yaws=YES
+# yaws_flags=""
+# yaws_id=""
+#
+
+if [ -f /etc/rc.subr ]
+then
+ . /etc/rc.subr
+fi
+
+name="yaws"
+rcvar=$name
+yaws_command="%prefix%bin/${name}"
+required_files="%etcdir%yaws.conf"
+
+start_cmd="yaws_start"
+stop_cmd="yaws_stop"
+status_cmd="yaws_status"
+reload_cmd="yaws_reload"
+extra_commands="reload status"
+
+: ${yaws_id:=default}
+: ${yaws_flags:=--heart}
+
+yaws_start() {
+ $yaws_command --id $yaws_id $yaws_flags --daemon
+}
+
+yaws_stop() {
+ $yaws_command --id $yaws_id --stop
+}
+
+yaws_status() {
+ $yaws_command --id $yaws_id --status
+}
+
+yaws_reload() {
+ $yaws_command --id $yaws_id --hup
+}
+
+if [ -f /etc/rc.subr -a -f /etc/rc.conf ]
+then
+ load_rc_config $name
+ run_rc_command "$1"
+else
+ yaws_start
+fi

0 comments on commit fabb01c

Please sign in to comment.