aboutsummaryrefslogtreecommitdiffstats
path: root/main/strongswan/charon.initd
blob: 12932660edce31e29147214bfa2ee5257e7c33f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/sbin/openrc-run

description="strongSwan charon IKE daemon"
command="/usr/lib/strongswan/charon"
pidfile="/var/run/charon.pid"
start_stop_daemon_args="--background"
extra_started_commands="reload fullstatus"

depend() {
	need net
	after firewall
	provide ipsec
}

start_post() {
	ebegin "Loading ${name:-$RC_SVCNAME} configuration"
	while [ ! -e $pidfile ]; do
		sleep 0.1
	done
	swanctl --load-all &>/dev/null
	eend $?
}

reload() {
	swanctl --reload-settings
	swanctl --load-all
}

fullstatus() {
	swanctl --list-conns
	swanctl --list-sas
}