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