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
646 B

  1. #!/bin/sh /etc/rc.common
  2. START=90
  3. STOP=10
  4. USE_PROCD=1
  5. PROG="/usr/libexec/ipsec/pluto"
  6. IPSEC_SECRETS=/etc/ipsec.secrets
  7. IPSEC_CONF=/etc/ipsec.conf
  8. IPSEC_BIN=/usr/sbin/ipsec
  9. checkconfig() {
  10. ${IPSEC_BIN} addconn --checkconfig || return 1
  11. }
  12. start_service() {
  13. checkconfig || return 1
  14. ipsec _stackmanager start
  15. # Enable nflog if configured
  16. ipsec --checknflog > /dev/null
  17. procd_open_instance
  18. procd_set_param command $PROG --config ${IPSEC_CONF} --nofork --secretsfile ${IPSEC_SECRETS}
  19. procd_set_param respawn
  20. procd_close_instance
  21. }
  22. stop_service() {
  23. ipsec whack --shutdown
  24. ipsec _stackmanager stop
  25. ipsec --stopnflog > /dev/null
  26. }