import { execSync } from 'child_process' // Returns one of: off, installed, enabled, running, synced, error function serviceStatus() { try { const stdout = execSync('systemctl status ao') const isServiceRunning = stdout.includes('Active: active (running)') if(isServiceRunning) return 'running' else if(stdout.includes('error')) return 'error' else if(stdout.includes('stopped')) return 'installed' } catch(err) { return 'error' } return 'off' } export default { description: 'AO server instance on this computer', status: serviceStatus }