Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # $FreeBSD: head/net-p2p/i2p/files/i2p.in 302141 2012-08-05 23:19:36Z dougb $
- #
- # Under a BSDL license. Copyright 2005. Mario S F Ferreira <lioux@FreeBSD.org>
- # PROVIDE: i2p
- # REQUIRE: LOGIN
- # KEYWORD: shutdown
- #
- # Add the following lines to /etc/rc.conf to enable i2p:
- #
- # i2p_enable="YES"
- # i2p_user
- . /etc/rc.subr
- name="i2p"
- rcvar=i2p_enable
- command="/opt/i2p/i2prouter"
- extra_commands="install uninstall update"
- i2p_user="i2p"
- start_cmd="start_cmd"
- stop_cmd="stop_cmd"
- status_cmd="status_cmd"
- restart_cmd="restart_cmd"
- install_cmd="install_cmd"
- uninstall_cmd="uninstall_cmd"
- update_cmd="update_cmd"
- generic_cmd()
- {
- su -l ${i2p_user} -c "${command} ${1}"
- }
- start_cmd()
- {
- generic_cmd start
- }
- stop_cmd()
- {
- generic_cmd stop
- }
- status_cmd()
- {
- generic_cmd status
- }
- restart_cmd()
- {
- generic_cmd restart
- }
- install_cmd()
- {
- generic_cmd install
- }
- uninstall_cmd()
- {
- generic_cmd uninstall
- }
- update_cmd()
- {
- generic_cmd update
- }
- load_rc_config "${name}"
- : ${i2p_enable="NO"}
- : ${i2p_user=""}
- run_rc_command "$1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement