hardcoding is bad
diff --git a/scripts/addP4DPN.sh b/scripts/addP4DPN.sh
index 8f3b00c..15da4f5 100755
--- a/scripts/addP4DPN.sh
+++ b/scripts/addP4DPN.sh
@@ -1,23 +1,23 @@
#!/bin/bash
-if [ "$#" -eq 1 ]; then
+if [ "$#" -eq 2 ]; then
echo ""
curl -i --header "Content-type: application/json" --request POST -u onos:rocks --data '{
"dpns": [
{
- "dpn-id": "'$1'",
+ "dpn-id": "'$2'",
"dpn-name": "site1-anchor1",
"dpn-groups": [
"foo"
],
- "node-id": "node'$1'",
- "network-id": "network'$1'",
+ "node-id": "node'$2'",
+ "network-id": "network'$2'",
"control-protocol": "p4-dpn-control-protocol",
"abstract": false
}
]
- }' 'http://192.168.105.14:8181/onos/restconf/data/ietf-dmm-fpcagent:tenants/tenant=default/fpc-topology'
+ }' 'http://'$1':8181/onos/restconf/data/ietf-dmm-fpcagent:tenants/tenant=default/fpc-topology'
echo ""
else
- echo "usage: "$0" dpnId (tenantId)"
+ echo "usage: "$0" <ONOS IP addr> <P4 device ID>"
fi