UNPKG

@autonomousorganization/ao-cli

Version:

An interactive command-line interface (CLI) tool to help you install, use, and administer an AO instance.

28 lines (24 loc) 635 B
import { execSync } from 'child_process' // Returns one of: off, installed, enabled, running, synced, error export function nginxStatus() { try { const stdout = execSync('nginx -v 2>&1') } catch(err) { return 'off' } try { const stdout = execSync('systemctl status nginx') if(stdout.includes('Active: active (running)')) { return 'running' } else if(stdout.includes('Active: inactive (dead)')) { return 'installed' } } catch(err) { return 'installed' } return 'installed' } export default { description: 'host AO publicly over the world wide web', status: nginxStatus }