searx.rc 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/sh
  2. # $FreeBSD: branches/2020Q4/www/searx/files/searx.in 463944 2018-03-09 08:34:57Z yuri $
  3. # PROVIDE: searx
  4. # REQUIRE: DAEMON NETWORKING
  5. # BEFORE: LOGIN
  6. # KEYWORD: shutdown
  7. # Add the following lines to /etc/rc.conf to enable searx:
  8. # searx_enable="YES"
  9. #
  10. # searx_enable (bool): Set to YES to enable searx
  11. # Default: NO
  12. # searx_conf (str): searx configuration file
  13. # Default: ${PREFIX}/etc/searx.conf
  14. # searx_user (str): searx daemon user
  15. # Default: searx
  16. # searx_group (str): searx daemon group
  17. # Default: searx
  18. # searx_flags (str): Extra flags passed to searx
  19. . /etc/rc.subr
  20. name="searx"
  21. rcvar=searx_enable
  22. : ${searx_enable:="NO"}
  23. : ${searx_user:="www"}
  24. : ${searx_group:="www"}
  25. : ${searx_flags:=""}
  26. export SEARX_SETTINGS_FILE="/usr/local/etc/searx-settings.yml"
  27. # daemon
  28. pidfile="/var/run/${name}.pid"
  29. python="/usr/local/bin/python3.7"
  30. script_py="/usr/local/lib/python3.7/site-packages/${name}/webapp.py"
  31. command=/usr/sbin/daemon
  32. procname="daemon"
  33. command_args=" -c -f -P ${pidfile} ${python} ${script_py}"
  34. start_precmd="searx_precmd"
  35. searx_precmd()
  36. {
  37. install -o ${searx_user} /dev/null ${pidfile}
  38. }
  39. load_rc_config $name
  40. run_rc_command "$1"