#!/bin/sh # # $FreeBSD: head/security/dradis/files/dradis.in 340872 2014-01-24 00:14:07Z mat $ # # PROVIDE: dradis # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable dradis: # dradis_enable="YES" # # Additional settings: # dradis_bindip="127.0.0.1" # IP: default 120.0.0.1 # dradis_port="3004" # listen port: default 3004 # # DO NOT CHANGE THESE DEFAULT VALUES HERE # . /etc/rc.subr name=dradis rcvar=dradis_enable dradis_enable=${dradis_enable-"NO"} dradis_bindip=${dradis_bindip-"127.0.0.1"} dradis_port=${dradis_port-"3004"} command=%%RUBY_CMD%% start_cmd=dradis_start sig_stop=INT extra_commands="initdb" initdb_cmd="dradis_initdb" dradis_initdb() { cd %%INSTDIR%%/server && env RAILS_ENV=production %%PREFIX%%/bin/rake dradis:reset } dradis_start() { cd %%INSTDIR%%/server && env RAILS_ENV=production %%RUBY_CMD%% script/rails server -d -b ${dradis_bindip} -p ${dradis_port} } load_rc_config $name run_rc_command "$1"