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.

35 lines
789 B

  1. #!/bin/sh
  2. # PROVIDE: acmed
  3. # REQUIRE: LOGIN cleanvar
  4. # KEYWORD: shutdown
  5. . /etc/rc.subr
  6. name="acmed"
  7. rcvar="${name}_enable"
  8. pidfile="/var/run/${name}.pid"
  9. acmed_config_file="/usr/local/etc/acmed/acmed.toml"
  10. required_files="${acmed_config_file}"
  11. command="/usr/local/bin/${name}"
  12. start_precmd="${name}_prestart"
  13. load_rc_config "$name"
  14. : ${acmed_enable:=no}
  15. : ${acmed_log_level:="info"}
  16. : ${acmed_root_cert:=}
  17. acmed_prestart()
  18. {
  19. if [ "$acmed_root_cert" != "" ]; then
  20. rc_flags="--root-cert ${acmed_root_cert} ${rc_flags}"
  21. fi
  22. if [ "$acmed_log_level" != "" ]; then
  23. rc_flags="--log-level ${acmed_log_level} ${rc_flags}"
  24. fi
  25. rc_flags="--log-syslog ${rc_flags}"
  26. rc_flags="--pid-file ${pidfile} ${rc_flags}"
  27. rc_flags="--config ${acmed_config_file} ${rc_flags}"
  28. }
  29. run_rc_command "$1"