Advertisement
Guest User

i2p

a guest
Mar 16th, 2014
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # $FreeBSD: head/net-p2p/i2p/files/i2p.in 302141 2012-08-05 23:19:36Z dougb $
  4. #
  5. # Under a BSDL license. Copyright 2005. Mario S F Ferreira <lioux@FreeBSD.org>
  6.  
  7. # PROVIDE: i2p
  8. # REQUIRE: LOGIN
  9. # KEYWORD: shutdown
  10.  
  11. #
  12. # Add the following lines to /etc/rc.conf to enable i2p:
  13. #
  14. # i2p_enable="YES"
  15. # i2p_user
  16.  
  17. . /etc/rc.subr
  18.  
  19. name="i2p"
  20. rcvar=i2p_enable
  21. command="/opt/i2p/i2prouter"
  22. extra_commands="install uninstall update"
  23.  
  24. i2p_user="i2p"
  25.  
  26. start_cmd="start_cmd"
  27. stop_cmd="stop_cmd"
  28. status_cmd="status_cmd"
  29. restart_cmd="restart_cmd"
  30. install_cmd="install_cmd"
  31. uninstall_cmd="uninstall_cmd"
  32. update_cmd="update_cmd"
  33.  
  34. generic_cmd()
  35. {
  36. su -l ${i2p_user} -c "${command} ${1}"
  37. }
  38.  
  39. start_cmd()
  40. {
  41. generic_cmd start
  42. }
  43.  
  44. stop_cmd()
  45. {
  46. generic_cmd stop
  47. }
  48.  
  49. status_cmd()
  50. {
  51. generic_cmd status
  52. }
  53.  
  54. restart_cmd()
  55. {
  56. generic_cmd restart
  57. }
  58.  
  59. install_cmd()
  60. {
  61. generic_cmd install
  62. }
  63.  
  64. uninstall_cmd()
  65. {
  66. generic_cmd uninstall
  67. }
  68.  
  69. update_cmd()
  70. {
  71. generic_cmd update
  72. }
  73.  
  74. load_rc_config "${name}"
  75. : ${i2p_enable="NO"}
  76. : ${i2p_user=""}
  77.  
  78. run_rc_command "$1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement