-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8308626
commit 4aaca1a
Showing
39 changed files
with
2,570 additions
and
1,069 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/sh | ||
# | ||
# PROVIDE: theonionbox | ||
# REQUIRE: DAEMON FILESYSTEMS | ||
# BEFORE: LOGIN | ||
|
||
# Add the following line to /etc/rc.conf to enable TheOnionBox. | ||
# theonionbox_enable (bool): Set it to "YES" to enable TheOnionBox. Default: NO | ||
|
||
# To achieve this, run the following line from the shell: | ||
# echo “theonionbox_enable=YES” >>/etc/rc.conf | ||
|
||
. /etc/rc.subr | ||
|
||
name="theonionbox" | ||
rcvar=theonionbox_enable | ||
|
||
load_rc_config ${name} | ||
|
||
: ${theonionbox_enable="NO"} | ||
: ${theonionbox_pidfile="/var/run/${name}.pid"} | ||
|
||
# | ||
# Set the following lines according to your installation: | ||
# | ||
|
||
# theonionbox_dir (str): Points to your theonionbox directory | ||
# Default: /your/path/to/theonionbox ... which you obviously have to alter! | ||
: ${theonionbox_dir="/your/path/to/theonionbox"} | ||
|
||
# theonionbox_conf (str): Points to your onionbox.cfg file. | ||
# Default: $(theonionbox_dir)/config/theonionbox.cfg | ||
: ${theonionbox_conf="${theonionbox_dir}/config/theonionbox.cfg"} | ||
|
||
# theonionbox_user (str): TheOnionBox daemon user. | ||
# Default: _tor | ||
# Please ensure that this user has write privileges to '{theonionbox_dir}/log' | ||
: ${theonionbox_user="_tor"} | ||
|
||
required_files=${theonionbox_conf} | ||
required_dirs=${theonionbox_dir} | ||
pidfile=${theonionbox_pidfile} | ||
|
||
# Please ensure that there is this symlink to the python version you intend to use! | ||
command_interpreter="/usr/local/bin/python" | ||
|
||
# That's out script | ||
command="${theonionbox_dir}/theonionbox.py --mode=service --config='${theonionbox_conf}'" | ||
start_cmd="/usr/sbin/daemon -u ${theonionbox_user} -p ${pidfile} ${command}" | ||
|
||
# Let's go! | ||
run_rc_command "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.