Alexander Afanasyev | 4c568f2 | 2014-05-23 17:18:06 -0700 | [diff] [blame] | 1 | #!/bin/sh -e |
| 2 | |
| 3 | if [ "$1" != "configure" ]; then |
| 4 | exit 0 |
| 5 | fi |
| 6 | |
| 7 | APP=nfd-autoreg |
| 8 | |
Zhiyi Zhang | c8050a9 | 2018-01-21 17:33:16 -0800 | [diff] [blame] | 9 | if [ ! -f /var/lib/ndn/$APP/.ndn/pib.db ]; then |
Alexander Afanasyev | 4c568f2 | 2014-05-23 17:18:06 -0700 | [diff] [blame] | 10 | # Create HOME and generate self-signed NDN certificate |
| 11 | sudo mkdir -p /var/lib/ndn/$APP/.ndn |
| 12 | sudo chown -R ndn:ndn /var/lib/ndn/$APP |
| 13 | sudo -u ndn -g ndn HOME=/var/lib/ndn/$APP ndnsec-keygen /localhost/daemons/$APP | \ |
| 14 | sudo -u ndn -g ndn HOME=/var/lib/ndn/$APP ndnsec-install-cert - |
| 15 | fi |
| 16 | |
| 17 | #DEBHELPER# |
| 18 | |
| 19 | exit 0 |