blob: c861d53348e5e0b4199c791cab11409b480dbabc [file] [log] [blame]
Alexander Afanasyev4c568f22014-05-23 17:18:06 -07001#!/bin/sh -e
2
3if [ "$1" != "configure" ]; then
4 exit 0
5fi
6
7APP=nfd-autoreg
8
Zhiyi Zhangc8050a92018-01-21 17:33:16 -08009if [ ! -f /var/lib/ndn/$APP/.ndn/pib.db ]; then
Alexander Afanasyev4c568f22014-05-23 17:18:06 -070010 # Create HOME and generate self-signed NDN certificate
11 sudo mkdir -p /var/lib/ndn/$APP/.ndn
12 sudo chown -R ndn:ndn /var/lib/ndn/$APP
Davide Pesavento3b0bfe82022-04-24 22:25:11 -040013 sudo -u ndn -g ndn HOME=/var/lib/ndn/$APP ndnsec key-gen /localhost/daemons/$APP | \
14 sudo -u ndn -g ndn HOME=/var/lib/ndn/$APP ndnsec cert-install -
Alexander Afanasyev4c568f22014-05-23 17:18:06 -070015fi
16
17#DEBHELPER#
18
19exit 0