I have an executable script (see below) that works perfectly if I execute it via the command line (OSX's Terminal).
However, I have an Indigo server Action that is supposed to run the script, but it doesn't ...
Any ideas on why the Indigo server would fail to execute a script that I can manually execute just fine?
- Code: Select all
#!/usr/bin/env node
var needleClient = require('needle'),
indigoAuth = { username: 'user', password: 'pass', auth: 'digest' };
function setVariable(variable, value, callback){
needleClient.put('http://127.0.0.1:8176/variables/'+ variable, 'value='+ String(value), indigoAuth, callback);
};
setVariable('alarmArmed', 'true', function(err, resp) { if(err){ console.log(err); } });