You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.2 KiB

  1. #!/bin/sh
  2. # PROVIDE: acmed
  3. # REQUIRE: LOGIN cleanvar
  4. # KEYWORD: shutdown
  5. #
  6. # Add the following lines to /etc/rc.conf to enable acmed:
  7. # acmed_enable (bool): Set it to "YES" to enable ACMEd.
  8. # Default is "NO".
  9. # acmed_config (string): Path to ACMEd configuration file.
  10. # Default is "%%PREFIX%%/etc/acmed/acmed.toml".
  11. # acmed_log_level (string): Set the log verbosity level.
  12. # Possible values are "error", "warn", "info",
  13. # "debug" and "trace".
  14. # Default is "info".
  15. # acmed_flags (string): Additional flags to be passed to acmed.
  16. # Default is "--log-syslog".
  17. #
  18. . /etc/rc.subr
  19. name="acmed"
  20. rcvar="${name}_enable"
  21. load_rc_config "$name"
  22. : ${acmed_enable:="NO"}
  23. : ${acmed_config:="%%PREFIX%%/etc/acmed/acmed.toml"}
  24. : ${acmed_log_level:="info"}
  25. : ${acmed_flags:="--log-syslog"}
  26. pidfile="/var/run/${name}.pid"
  27. command="/usr/local/bin/${name}"
  28. command_args="--config ${acmed_config} --pid-file ${pidfile} --log-level ${acmed_log_level} ${command_args}"
  29. required_files="${acmed_config}"
  30. run_rc_command "$1"