| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
case "$1" in |
| 6 |
configure) |
| 7 |
id -g _iked > /dev/null 2>&1 || \ |
| 8 |
addgroup --system --force-badname _iked |
| 9 |
id _iked > /dev/null 2>&1 || \ |
| 10 |
adduser --system --home /var/lib/openiked/empty \ |
| 11 |
--no-create-home --disabled-password \ |
| 12 |
--gecos "OpenIKED IKEv2 daemon" \ |
| 13 |
--force-badname \ |
| 14 |
--ingroup _iked _iked |
| 15 |
|
| 16 |
[ -f /etc/iked/private/local.key ] || \ |
| 17 |
openssl ecparam -genkey -name prime256v1 -noout \ |
| 18 |
-out "/etc/iked/private/local.key" |
| 19 |
[ -f /etc/iked/local.pub ] || \ |
| 20 |
openssl ec -in "/etc/iked/private/local.key" -pubout\ |
| 21 |
-out "/etc/iked/local.pub" |
| 22 |
;; |
| 23 |
|
| 24 |
abort-upgrade|abort-remove|abort-deconfigure|reconfigure) |
| 25 |
;; |
| 26 |
|
| 27 |
*) |
| 28 |
echo "postinst called with unknown argument \`$1'" >&2 |
| 29 |
exit 1 |
| 30 |
;; |
| 31 |
esac |
| 32 |
|
| 33 |
#DEBHELPER# |
| 34 |
|
| 35 |
exit 0 |