fix(migration): properly transform v3 flat structure to v4 nested snmp config
The v3→v4 migration was only renaming upsList to upsDevices without transforming the device structure. V3 had a flat structure with SNMP fields directly on the device object, while v4 expects a nested 'snmp' object. This commit fixes the migration to: - Move host, port, community, version, etc. into nested snmp object - Convert version from string to number - Add default timeout (5000ms) - Create thresholds object with defaults - Preserve all SNMPv1, v2c, and v3 authentication fields Also includes install.sh fix for better non-interactive handling.
This commit is contained in:
@@ -98,7 +98,11 @@ if [ ! -t 0 ] || [ ! -t 1 ]; then
|
||||
echo "Script detected it's running in a non-interactive environment without -y flag."
|
||||
echo "Attempting to find a controlling terminal for interactive prompts..."
|
||||
# Try to use a controlling terminal for user input
|
||||
exec < /dev/tty 2>/dev/null || INTERACTIVE=0
|
||||
if exec < /dev/tty 2>/dev/null && [ -t 0 ]; then
|
||||
INTERACTIVE=1
|
||||
else
|
||||
INTERACTIVE=0
|
||||
fi
|
||||
|
||||
if [ $INTERACTIVE -eq 0 ]; then
|
||||
echo "ERROR: No controlling terminal available for interactive prompts."
|
||||
|
Reference in New Issue
Block a user