summaryrefslogtreecommitdiffstats
path: root/abs/core/ca-certificates/ca-certificates.install
blob: 3d8b87d3a8d3b4c1f86dad0728e5e049bb3ed7ac (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
export LC_ALL=C

post_install() {
	usr/sbin/update-ca-certificates --fresh >/dev/null 2>&1
}

post_upgrade() {
	if [ $(vercmp $2 20110421-1) -lt 0 ]; then
		echo 'Updating certificates. This might take a while...'
	fi
	usr/sbin/update-ca-certificates --fresh >/dev/null 2>&1
}

pre_remove() {
	# clean up certificates
	local _backup=$(mktemp)
	mv etc/ca-certificates.conf ${_backup}
	echo > etc/ca-certificates.conf
	usr/sbin/update-ca-certificates --fresh >/dev/null 2>&1
	mv ${_backup} etc/ca-certificates.conf
}

post_remove() {
	# remove the cert file if it is empty
	[[ -s etc/ssl/certs/ca-certificates.crt ]] || rm -f etc/ssl/certs/ca-certificates.crt
}