Call for testers: www/shellinabox (Shell in a Box)

Doug Barton dougb at FreeBSD.org
Fri Jun 25 02:10:31 UTC 2010


On 06/24/10 15:51, Olivier Cochard-Labbé wrote:
> Hi all,
> 
> I've just finished my port of Shell in a Box: It's a secure web server
> that provide ajax terminal emulator.
> More information on the official website: http://code.google.com/p/shellinabox/
> 
> Before to submit it, Can someone test it ?
> You can found the port here: http://gugus69.free.fr/tools/shellinabox.tgz

I didn't test the port, but attached is a diff to your rc.d script. For
more information take a look at
http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/rc-scripts.html

Some notes:
1. We like to have a $FreeBSD id line in rc.d scripts
2. We support case sensitivity for arguments like your _fib option, so
case is a better choice here.
3. You need a default for _enable. To see why, comment out the entry you
have in /etc/rc.conf[.local] and then try running the script.
4. There is no need for a custom start_cmd here, and it's better to take
advantage of the rc.d infrastructure (that includes fixing your typo for
pidfile).
5. I added the required_dirs since it seems like that's mandatory.
6. By convention the argument for backgrounding the daemon is the last
one listed, but that's just a style nit.


hth,

Doug

-- 

	... and that's just a little bit of history repeating.
			-- Propellerheads

	Improve the effectiveness of your Internet presence with
	a domain name makeover!    http://SupersetSolutions.com/

-------------- next part --------------
--- shellinaboxd.in.orig	2010-06-24 15:44:16.000000000 -0700
+++ shellinaboxd.in	2010-06-24 19:02:03.000000000 -0700
@@ -1,4 +1,6 @@
 #!/bin/sh
+
+# $FreeBSD$
 #
 # Shell in a Box Daemon startup script
 #
@@ -20,11 +22,14 @@
 
 shellinaboxd_setfib() {
 	sysctl net.fibs >/dev/null 2>&1 || return 0
-	if [ "x${shellinaboxd_fib}" != "xNONE" ]; then
+
+	case "$shellinaboxd_fib" in
+	[Nn][Oo][Nn][Ee])
+		;;
+	*)
 		command="setfib -F ${shellinaboxd_fib} ${command}"
-	else
-		return 0
-	fi
+		;;
+	esac
 } 
 
 . /etc/rc.subr
@@ -36,13 +41,16 @@
 start_precmd="shellinaboxd_setfib"
 
 load_rc_config $name
+
+shellinaboxd_enable=${shellinaboxd_enable:-"NO"}
 shellinaboxd_fib=${shellinaboxd_fib:-"NONE"}
-shellinaboxd_pidfile=${shellinaboxd_pidfile:-"/var/run/shellinaboxd.pid"}
 shellinaboxd_port=${shellinaboxd_port:-"4200"}
 shellinaboxd_certdir=${shellinaboxd_certdir:-"%%PREFIX%%/etc/shellinabox"}
 
-start_cmd="$command --port=${shellinaboxd_port} --background=${shellinaboxd_pidfile} --cert=${shellinaboxd_certdir}"
+pidfile=${shellinaboxd_pidfile:-"/var/run/shellinaboxd.pid"}
+
+required_dirs="${shellinaboxd_certdir}"
 
-pid_file=${shellinaboxd_pidfile}
+command_args="--port=${shellinaboxd_port} --cert=${shellinaboxd_certdir} --background=${pidfile}"
 
 run_rc_command "$1"


More information about the freebsd-ports mailing list