blob: 84463aaf2ce6c393cb87b5bead6d2874d710ee73 [file] [log] [blame]
#!/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 2>/dev/null)" ]; 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