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 | |
| 7 | mkdir -p /var/log/ndn |
| 8 | chown -R ndn:ndn /var/log/ndn |
| 9 | |
| 10 | if [ ! -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' |
| 27 | fi |
| 28 | |
| 29 | #DEBHELPER# |
| 30 | |
| 31 | exit 0 |