diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-05-09 15:39:51 +0000 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-05-09 15:39:51 +0000 |
| commit | 42f6aae25938f97eae317a2439a660c54a89ef1c (patch) | |
| tree | 29a547729d17281957a91816edd8dcbd391334b6 /netconf-service | |
| parent | 99c5fae9dae76f260c641bc4411f38aad24f4ae1 (diff) | |
| download | infinitytier-42f6aae25938f97eae317a2439a660c54a89ef1c.tar.gz infinitytier-42f6aae25938f97eae317a2439a660c54a89ef1c.zip | |
More netconf work... set ZT_HOME and chdir there on service launch.
Diffstat (limited to 'netconf-service')
| -rw-r--r-- | netconf-service/index.js | 4 | ||||
| -rwxr-xr-x | netconf-service/netconf.service | 13 |
2 files changed, 16 insertions, 1 deletions
diff --git a/netconf-service/index.js b/netconf-service/index.js index 671836de..81b0e37f 100644 --- a/netconf-service/index.js +++ b/netconf-service/index.js @@ -476,6 +476,7 @@ function doNetconfRequest(message) }],function(err) { + // Send response to parent process if (err) { console.error('unable to generate certificate for peer '+peerId.address()+' on network '+nwid+': '+err); response.data['error'] = 'ACCESS_DENIED'; // unable to generate certificate @@ -489,7 +490,8 @@ function doNetconfRequest(message) //netconf.data[ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_DEPTH] = 0; //netconf.data[ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_RATES] = ''; netconf.data[ZT_NETWORKCONFIG_DICT_KEY_PRIVATE] = privateNetwork ? '1' : '0'; - netconf.data[ZT_NETWORKCONFIG_DICT_KEY_NAME] = network['name']; + if (network['name']) + netconf.data[ZT_NETWORKCONFIG_DICT_KEY_NAME] = network['name']; if (network['desc']) netconf.data[ZT_NETWORKCONFIG_DICT_KEY_DESC] = network['desc']; if ((v4NeedAssign)&&(v4Assignments.length > 0)) diff --git a/netconf-service/netconf.service b/netconf-service/netconf.service new file mode 100755 index 00000000..5371ff0c --- /dev/null +++ b/netconf-service/netconf.service @@ -0,0 +1,13 @@ +#!/bin/bash + +export PATH=/bin:/usr/bin:/usr/local/bin + +# We will start in ZT_HOME + +if [ ! -d ./services.d/netconf-service ]; then + echo 'cannot find netconf-service subfolder to launch subprocess' >>&2 + exit 1 +fi + +cd services.d/netconf-service +exec node index.js |
