#!/bin/bash # Detect system type on remote host # Usage: ./detect-system.sh TARGET_HOST="$1" if [ -z "$TARGET_HOST" ]; then echo "Usage: $0 " exit 1 fi # Try to detect system type if ssh -o ConnectTimeout=5 root@${TARGET_HOST} "test -f /usr/bin/pvesh" 2>/dev/null; then echo "proxmox" elif ssh -o ConnectTimeout=5 root@${TARGET_HOST} "test -f /usr/local/bin/freenas-version || test -f /usr/local/bin/truenas-version" 2>/dev/null; then echo "truenas" elif ssh -o ConnectTimeout=5 root@${TARGET_HOST} "test -f /usr/local/sbin/pfSsh.php" 2>/dev/null; then echo "pfsense" elif ssh -o ConnectTimeout=5 root@${TARGET_HOST} "test -f /usr/sbin/univention-config-registry" 2>/dev/null; then echo "ucs" else echo "unknown" fi