blob: 84403d08e27aa4000f495d84fcf647e31612b4c1 [file] [log] [blame]
#!/bin/sh -e
if [ "$1" != "configure" ]; then
exit 0
fi
APP=ndn-autoconfig-server
if [ ! -f /var/lib/ndn/$APP/.ndn/pib.db ]; then
# Create HOME and generate self-signed NDN certificate
sudo mkdir -p /var/lib/ndn/$APP/.ndn
sudo chown -R ndn:ndn /var/lib/ndn/$APP
sudo -u ndn -g ndn HOME=/var/lib/ndn/$APP ndnsec key-gen /localhost/daemons/$APP | \
sudo -u ndn -g ndn HOME=/var/lib/ndn/$APP ndnsec cert-install -
fi
#DEBHELPER#
exit 0