summaryrefslogtreecommitdiffstats
path: root/debian/postinst
blob: 485edae14ce5f84a502dc91b2e9ad1f25932704b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

# generate certificates if absent
if [ ! -f "/etc/fake_ilo/server.crt" ]; then
	if [ ! -f "/etc/fake_ilo/server.key" ]; then
		mkdir /etc/fake_ilo/
		echo "Creating certificates"
		openssl req -x509 -newkey rsa:2048 -keyout /etc/fake_ilo/server.key -out /etc/fake_ilo/server.crt -nodes -days 9999 -subj "/C=MD/ST=Chisinau/L=Chisinau/O=IT/CN=$(hostname -f)"
	fi
fi

# enable the init script
update-rc.d -f fake_ilo defaults
invoke-rc.d fake_ilo start