Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
amark committed Apr 25, 2023
1 parent 58f9135 commit c9283d8
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lib/axe.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function start(root){
try{ (cmd[msg.try]||cmd.any)(msg, peer); }catch(err){ mesh.say({dam: '!', err: "service error: "+err}) }
}
cmd.https = function(msg, peer){ var run, log;
if(!(run = require('child_process').execSync)){ return }
if(!(run = require('child_process').exec)){ return }
if(!msg.email || !msg.domain){
mesh.say({dam: '!', err: 'Domain/email missing, use `location.hostname`!'});
return;
Expand All @@ -227,11 +227,11 @@ function start(root){
var path = require('path').resolve(__dirname, '../examples');
//log = run("bash "+path+"/https.sh", {env: {'EMAIL': msg.email, 'WEB': path, 'DOMAIN': msg.domain}});//, (err, stdout, stderr) => {
require('fs').writeFileSync(path+'/../email', msg.email);
log = run("bash "+path+"/https.sh", {env:{'EMAIL': msg.email, 'WEB': path, 'DOMAIN': msg.domain}});//, (err, stdout, stderr) => {
//log = JSON.stringify({err, stdout, stderr});
mesh.say({dam: '!', log: ''+log}, peer);
setTimeout(function(){ process.exit() },999);
//});
run("bash "+path+"/https.sh", {env:{'EMAIL': msg.email, 'WEB': path, 'DOMAIN': msg.domain}}, function(e, out, err){
log = JSON.stringify({e: e, out: out, err: err});
mesh.say({dam: '!', log: ''+log}, peer);
setTimeout(function(){ process.exit() },999);
});
return;
// log = run('curl https://get.acme.sh | /bin/sh -s email='+msg.email);
// mesh.say({dam: '!', log: ''+log}, peer);
Expand All @@ -252,11 +252,13 @@ function start(root){
cmd.update = function(msg, peer){ var run, log, pass;
try{ pass = ''+require('fs').readFileSync(require('os').homedir()+'/pass') }catch(e){}
if(!pass || msg.pass != pass){ return }
if(!(run = require('child_process').execSync)){ return }
if(!(run = require('child_process').exec)){ return }
var path = require('path').resolve(__dirname, '../examples');
log = run("bash "+path+"/install.sh", {env: {VERSION: msg.version||''}});
mesh.say({dam: '!', log: ''+log}, peer);
setTimeout(function(){ process.exit() },999);
run("bash "+path+"/install.sh", {env: {VERSION: msg.version||''}}, function(e, out, err){
log = JSON.stringify({e: e, out: out, err: err});
mesh.say({dam: '!', log: ''+log}, peer);
setTimeout(function(){ process.exit() },999);
});
}

cmd.any = function(){};
Expand Down

0 comments on commit c9283d8

Please sign in to comment.