You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
567 B
20 lines
567 B
import { execSync } from 'child_process' |
|
|
|
// Returns one of: off, installed, enabled, running, synced, error |
|
export function bitcoinStatus() { |
|
try { |
|
const stdout = execSync('source ~/Alchemy/ingredients/lead && source ~/Alchemy/ingredients/gold && bitcoin_is_synced') |
|
const isSynced = stdout.includes('Bitcoin is synced!') |
|
if(isSynced) return 'synced' |
|
else if(stdout.includes('error')) return 'error' |
|
} catch(err) { |
|
return 'error' |
|
} |
|
return 'off' |
|
} |
|
|
|
export default { |
|
name: 'Bitcoin', |
|
description: 'payments', |
|
status: bitcoinStatus |
|
}
|
|
|