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.

36 lines
674 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. mkdir -p /var/run/pluto
  12. }
  13. start_service() {
  14. checkconfig || return 1
  15. ipsec _stackmanager start
  16. # Enable nflog if configured
  17. ipsec --checknflog > /dev/null
  18. procd_open_instance
  19. procd_set_param command $PROG --config ${IPSEC_CONF} --nofork --secretsfile ${IPSEC_SECRETS}
  20. procd_set_param respawn
  21. procd_close_instance
  22. }
  23. stop_service() {
  24. ipsec whack --shutdown
  25. ipsec _stackmanager stop
  26. ipsec --stopnflog > /dev/null
  27. }