blob: e4c4ff87d16fed3635a6fecabf63ac55ea7ec3f6 [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
Alexander Afanasyev60664e22015-02-03 11:55:06 -080016 (
17 export HOME=/var/lib/ndn/nfd
18 ndnsec-keygen /localhost/daemons/nfd | ndnsec-install-cert -
19 )
Alexander Afanasyev469cbcd2014-05-08 01:25:11 -070020
21 # Create HOME and generate self-signed NDN certificate for nrd
Alexander Afanasyev469cbcd2014-05-08 01:25:11 -070022 # Dump RIB Management daemon's certificate
Alexander Afanasyev60664e22015-02-03 11:55:06 -080023 mkdir -p /var/lib/ndn/nrd/.ndn
24 (
25 export HOME=/var/lib/ndn/nrd
26 ndnsec-keygen /localhost/daemons/nrd | ndnsec-install-cert -
27
28 mkdir /etc/ndn/certs
29 ndnsec-dump-certificate -i /localhost/daemons/nrd > \
30 /etc/ndn/certs/localhost_daemons_nrd.ndncert
31 )
Alexander Afanasyev469cbcd2014-05-08 01:25:11 -070032fi
33
Alexander Afanasyev60664e22015-02-03 11:55:06 -080034chown -R ndn:ndn /var/lib/ndn
35
Alexander Afanasyev469cbcd2014-05-08 01:25:11 -070036#DEBHELPER#
37
38exit 0