#!/bin/bash | |
FACEURI=$1 | |
if ! CREATE=$(nfdc create $FACEURI) | |
then | |
return 1 | |
fi | |
sleep 1 | |
FACEID=$(echo $CREATE | grep -Po 'FaceId: .*?,' | sed 's/FaceId: //' | sed 's/,//') | |
if ! output=$(nfdc add-nexthop ndn:/ $FACEID) | |
then | |
return 2 | |
fi | |
output=$(nfdc add-nexthop ndn:/localhost/test-out $FACEID 2>&1) | |
return 0 |