feat(cli): Add uninstall command to CLI and update shutdown delay for graceful VM shutdown

This commit is contained in:
2025-03-25 11:05:58 +00:00
parent cf231e9785
commit 0a459f9cd0
5 changed files with 167 additions and 15 deletions

View File

@ -514,9 +514,10 @@ export class NupstSnmp {
public async initiateShutdown(reason: string): Promise<void> {
console.log(`Initiating system shutdown due to: ${reason}`);
try {
// Execute shutdown command
const { stdout } = await execAsync('shutdown -h +1 "UPS battery critical, shutting down in 1 minute"');
// Execute shutdown command with 5 minute delay to allow for VM graceful shutdown
const { stdout } = await execAsync('shutdown -h +5 "UPS battery critical, shutting down in 5 minutes"');
console.log('Shutdown initiated:', stdout);
console.log('Allowing 5 minutes for VMs to shut down safely');
} catch (error) {
console.error('Failed to initiate shutdown:', error);
// Try a different method if first one fails