Alexander Afanasyev | 469cbcd | 2014-05-08 01:25:11 -0700 | [diff] [blame] | 1 | #!/bin/sh -e |
| 2 | |
| 3 | if [ "$1" != "configure" ]; then |
| 4 | exit 0 |
| 5 | fi |
| 6 | |
Alexander Afanasyev | a4ce620 | 2014-08-10 18:17:52 -0700 | [diff] [blame] | 7 | |
| 8 | if [ ! -d /var/log/ndn ]; then |
| 9 | mkdir -p /var/log/ndn |
| 10 | chown -R ndn:ndn /var/log/ndn |
| 11 | fi |
Alexander Afanasyev | 469cbcd | 2014-05-08 01:25:11 -0700 | [diff] [blame] | 12 | |
| 13 | if [ ! -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 Afanasyev | 60664e2 | 2015-02-03 11:55:06 -0800 | [diff] [blame^] | 16 | ( |
| 17 | export HOME=/var/lib/ndn/nfd |
| 18 | ndnsec-keygen /localhost/daemons/nfd | ndnsec-install-cert - |
| 19 | ) |
Alexander Afanasyev | 469cbcd | 2014-05-08 01:25:11 -0700 | [diff] [blame] | 20 | |
| 21 | # Create HOME and generate self-signed NDN certificate for nrd |
Alexander Afanasyev | 469cbcd | 2014-05-08 01:25:11 -0700 | [diff] [blame] | 22 | # Dump RIB Management daemon's certificate |
Alexander Afanasyev | 60664e2 | 2015-02-03 11:55:06 -0800 | [diff] [blame^] | 23 | 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 Afanasyev | 469cbcd | 2014-05-08 01:25:11 -0700 | [diff] [blame] | 32 | fi |
| 33 | |
Alexander Afanasyev | 60664e2 | 2015-02-03 11:55:06 -0800 | [diff] [blame^] | 34 | chown -R ndn:ndn /var/lib/ndn |
| 35 | |
Alexander Afanasyev | 469cbcd | 2014-05-08 01:25:11 -0700 | [diff] [blame] | 36 | #DEBHELPER# |
| 37 | |
| 38 | exit 0 |