blob: d6081294f421f6d12695e0c26c851353d10e36bb [file] [log] [blame]
Alexander Afanasyev469cbcd2014-05-08 01:25:11 -07001#!/bin/sh -e
2
3if [ "$1" != "configure" ]; then
4 exit 0
5fi
6
7mkdir -p /var/log/ndn
8chown -R ndn:ndn /var/log/ndn
9
10if [ ! -f /etc/ndn/certs/localhost_daemons_nrd.ndncert ]; then
11 # Create HOME and generate self-signed NDN certificate for nfd
12 mkdir -p /var/lib/ndn/nfd/.ndn
13 HOME=/var/lib/ndn/nfd ndnsec-keygen /localhost/daemons/nfd | \
14 HOME=/var/lib/ndn/nfd ndnsec-install-cert -
15
16 # Create HOME and generate self-signed NDN certificate for nrd
17 sudo mkdir -p /var/lib/ndn/nrd/.ndn
18 sudo chown -R ndn:ndn /var/lib/ndn/nrd
19 sudo -u ndn -g ndn HOME=/var/lib/ndn/nrd ndnsec-keygen /localhost/daemons/nrd | \
20 sudo -u ndn -g ndn HOME=/var/lib/ndn/nrd ndnsec-install-cert -
21
22 # Dump RIB Management daemon's certificate
23 sudo mkdir /etc/ndn/certs
24 sudo sh -c 'sudo -u ndn -g ndn HOME=/var/lib/ndn/nrd \
25 ndnsec-dump-certificate -i /localhost/daemons/nrd \
26 > /etc/ndn/certs/localhost_daemons_nrd.ndncert'
27fi
28
29#DEBHELPER#
30
31exit 0