blob: fb1dc755071093a970a722b5bbdbe2d6f5b08a73 [file] [log] [blame]
Alexander Afanasyev469cbcd2014-05-08 01:25:11 -07001#!/bin/sh -e
2
3if [ "$1" != "configure" ]; then
Alexander Afanasyev790bb212015-03-15 19:19:25 -07004 exit 0
Alexander Afanasyev469cbcd2014-05-08 01:25:11 -07005fi
6
Alexander Afanasyev790bb212015-03-15 19:19:25 -07007# Create log folder
8mkdir -p "/var/log/ndn"
Alexander Afanasyeva4ce6202014-08-10 18:17:52 -07009
Alexander Afanasyev790bb212015-03-15 19:19:25 -070010# Create HOME and generate self-signed NDN certificate
11mkdir -p "/var/lib/ndn/nfd/.ndn"
Alexander Afanasyev469cbcd2014-05-08 01:25:11 -070012
Alexander Afanasyev790bb212015-03-15 19:19:25 -070013(
14 export HOME="/var/lib/ndn/nfd"
Davide Pesavento3b0bfe82022-04-24 22:25:11 -040015 if [ -z "$(ndnsec get-default 2>/dev/null)" ]; then
16 ndnsec key-gen "/localhost/daemons/nfd" | ndnsec cert-install -
Alexander Afanasyev790bb212015-03-15 19:19:25 -070017 fi
Alexander Afanasyev469cbcd2014-05-08 01:25:11 -070018
Alexander Afanasyev790bb212015-03-15 19:19:25 -070019 mkdir -p "/etc/ndn/certs"
Davide Pesavento3b0bfe82022-04-24 22:25:11 -040020 ndnsec cert-dump -i "$(ndnsec get-default)" > \
Alexander Afanasyev790bb212015-03-15 19:19:25 -070021 "/etc/ndn/certs/localhost_daemons_nfd.ndncert"
22)
Alexander Afanasyev60664e22015-02-03 11:55:06 -080023
Alexander Afanasyev790bb212015-03-15 19:19:25 -070024chown -R ndn:ndn "/var/lib/ndn/nfd"
Alexander Afanasyev60664e22015-02-03 11:55:06 -080025
Junxiao Shid9bd0152018-04-20 16:49:30 +000026# Enable Ethernet face creation
27setcap cap_net_raw,cap_net_admin=eip /usr/bin/nfd
28
Alexander Afanasyev469cbcd2014-05-08 01:25:11 -070029#DEBHELPER#
30
31exit 0