blob: 8c4c667f62e5694d618727cbc7676475cba7f622 [file] [log] [blame]
#!/bin/sh -e
if [ "$1" != "configure" ]; then
exit 0
fi
if [ ! -d /var/log/ndn ]; then
mkdir -p /var/log/ndn
chown -R ndn:ndn /var/log/ndn
fi
if [ ! -f /etc/ndn/certs/localhost_daemons_nrd.ndncert ]; then
# Create HOME and generate self-signed NDN certificate for nfd
mkdir -p /var/lib/ndn/nfd/.ndn
HOME=/var/lib/ndn/nfd ndnsec-keygen /localhost/daemons/nfd | \
HOME=/var/lib/ndn/nfd ndnsec-install-cert -
# Create HOME and generate self-signed NDN certificate for nrd
sudo mkdir -p /var/lib/ndn/nrd/.ndn
sudo chown -R ndn:ndn /var/lib/ndn/nrd
sudo -u ndn -g ndn HOME=/var/lib/ndn/nrd ndnsec-keygen /localhost/daemons/nrd | \
sudo -u ndn -g ndn HOME=/var/lib/ndn/nrd ndnsec-install-cert -
# Dump RIB Management daemon's certificate
sudo mkdir /etc/ndn/certs
sudo sh -c 'sudo -u ndn -g ndn HOME=/var/lib/ndn/nrd \
ndnsec-dump-certificate -i /localhost/daemons/nrd \
> /etc/ndn/certs/localhost_daemons_nrd.ndncert'
fi
#DEBHELPER#
exit 0