#!/bin/sh -e | |
if [ "$1" != "configure" ]; then | |
exit 0 | |
fi | |
# Create log folder | |
mkdir -p "/var/log/ndn" | |
# Create HOME and generate self-signed NDN certificate | |
mkdir -p "/var/lib/ndn/nfd/.ndn" | |
( | |
export HOME="/var/lib/ndn/nfd" | |
if [ -z "$(ndnsec-get-default)" ]; then | |
ndnsec-keygen "/localhost/daemons/nfd" | ndnsec-install-cert - | |
fi | |
mkdir -p "/etc/ndn/certs" | |
ndnsec-dump-certificate -i "$(ndnsec-get-default)" > \ | |
"/etc/ndn/certs/localhost_daemons_nfd.ndncert" | |
) | |
chown -R ndn:ndn "/var/lib/ndn/nfd" | |
#DEBHELPER# | |
exit 0 |