| 1 | #!/sbin/openrc-run |
| 2 | |
| 3 | description="strongSwan charon IKE daemon" |
| 4 | command="/usr/lib/strongswan/charon" |
| 5 | pidfile="/var/run/charon.pid" |
| 6 | start_stop_daemon_args="--background" |
| 7 | extra_started_commands="reload fullstatus" |
| 8 | |
| 9 | depend() { |
| 10 | need net |
| 11 | after firewall |
| 12 | provide ipsec |
| 13 | } |
| 14 | |
| 15 | start_post() { |
| 16 | ebegin "Loading ${name:-$RC_SVCNAME} configuration" |
| 17 | while [ ! -e $pidfile ]; do |
| 18 | sleep 0.1 |
| 19 | done |
| 20 | swanctl --load-all &>/dev/null |
| 21 | eend $? |
| 22 | } |
| 23 | |
| 24 | reload() { |
| 25 | swanctl --reload-settings |
| 26 | swanctl --load-all |
| 27 | } |
| 28 | |
| 29 | fullstatus() { |
| 30 | swanctl --list-conns |
| 31 | swanctl --list-sas |
| 32 | } |