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 |
| 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' |
| 30 | fi |
| 31 | |
| 32 | #DEBHELPER# |
| 33 | |
| 34 | exit 0 |