Files
kvm/ui/dev_device.sh
luckfox-eng29 8fbd6bcf0d Add support for Luckfox PicoKVM
Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
2025-09-16 11:58:09 +08:00

30 lines
869 B
Bash
Executable File

#!/usr/bin/env bash
# Check if an IP address was provided as an argument
if [ -z "$1" ]; then
echo "Usage: $0 <KVM IP Address>"
exit 1
fi
ip_address="$1"
# Print header
echo "┌──────────────────────────────────────┐"
echo "│ KVM Development Setup │"
echo "└──────────────────────────────────────┘"
# Set the environment variable and run Vite
echo "Starting development server with KVM device at: $ip_address"
# Check if pwd is the current directory of the script
if [ "$(pwd)" != "$(dirname "$0")" ]; then
pushd "$(dirname "$0")" > /dev/null
echo "Changed directory to: $(pwd)"
fi
sleep 1
KVM_PROXY_URL="ws://$ip_address" npx vite dev --mode=device
popd > /dev/null