#!/usr/bin/env -S deno run --allow-all /** * NUPST - UPS Shutdown Tool * * A command-line tool for monitoring SNMP-enabled UPS devices and * initiating system shutdown when power conditions are critical. * * Required Permissions: * - --allow-net: SNMP communication with UPS devices * - --allow-read: Read configuration files (/etc/nupst/config.json) * - --allow-write: Write configuration files * - --allow-run: Execute system commands (systemctl, shutdown, git, bash) * - --allow-sys: Access system information (hostname, OS details) * - --allow-env: Read environment variables * * @module */ import { NupstCli } from './ts/cli.ts'; /** * Main entry point for the NUPST application * Parses command-line arguments and executes the requested command */ async function main(): Promise { const cli = new NupstCli(); await cli.parseAndExecute(Deno.args); } // Execute main and handle errors if (import.meta.main) { try { await main(); } catch (error) { console.error(`Error: ${error instanceof Error ? error.message : String(error)}`); Deno.exit(1); } }