blob: fb1dc755071093a970a722b5bbdbe2d6f5b08a73 [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 key-gen "/localhost/daemons/nfd" | ndnsec cert-install -
fi
mkdir -p "/etc/ndn/certs"
ndnsec cert-dump -i "$(ndnsec get-default)" > \
"/etc/ndn/certs/localhost_daemons_nfd.ndncert"
)
chown -R ndn:ndn "/var/lib/ndn/nfd"
# Enable Ethernet face creation
setcap cap_net_raw,cap_net_admin=eip /usr/bin/nfd
#DEBHELPER#
exit 0