filtron.rc 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. # $FreeBSD: branches/2020Q1/www/filtron/files/filtron.in 463944 2018-03-09 08:34:57Z yuri $
  3. # PROVIDE: filtron
  4. # REQUIRE: DAEMON NETWORKING
  5. # BEFORE: LOGIN
  6. # KEYWORD: shutdown
  7. # Add the following lines to /etc/rc.conf to enable filtron:
  8. # filtron_enable="YES"
  9. #
  10. # filtron_enable (bool): Set to YES to enable filtron
  11. # Default: NO
  12. # filtron_conf (str): filtron configuration file
  13. # Default: ${PREFIX}/etc/filtron.conf
  14. # filtron_user (str): filtron daemon user
  15. # Default: filtron
  16. # filtron_group (str): filtron daemon group
  17. # Default: filtron
  18. # filtron_flags (str): Extra flags passed to filtron
  19. . /etc/rc.subr
  20. name="filtron"
  21. rcvar=filtron_enable
  22. : ${filtron_enable:="NO"}
  23. : ${filtron_user:="www"}
  24. : ${filtron_group:="www"}
  25. : ${filtron_flags:=""}
  26. # daemon
  27. pidfile="/var/run/${name}.pid"
  28. command=/usr/local/bin/filtron
  29. procname="daemon"
  30. command_args=" -rules /usr/local/etc/filtron-rules.json -listen 0.0.0.0:4004 &"
  31. start_precmd="filtron_precmd"
  32. filtron_precmd()
  33. {
  34. install -o ${filtron_user} /dev/null ${pidfile}
  35. }
  36. load_rc_config $name
  37. run_rc_command "$1"