| 4 | import { tuiPrompts } from '../prompts' |
| 5 | |
| 6 | export const runStopMenu = async (): Promise<number> => { |
| 7 | const nginx = await tuiPrompts.confirm({ |
| 8 | message: 'Include Nginx stack while stopping?', |
| 9 | initialValue: false, |
| 10 | }) |
| 11 | |
| 12 | if (tuiPrompts.isCancel(nginx)) { |
| 13 | tuiPrompts.cancel('Cancelled') |
| 14 | return 1 |
| 15 | } |
| 16 | |
| 17 | const spinner = ora('Stopping relay...').start() |
| 18 | const code = await runStop({ tor: true, i2p: true, local: true, nginx }, []) |
| 19 | |
| 20 | if (code === 0) { |
| 21 | spinner.succeed('Relay stop command completed') |
| 22 | } else { |
| 23 | spinner.fail('Relay stop command failed') |
| 24 | } |
| 25 | |
| 26 | return code |
| 27 | } |