diff --git a/npu/build/build_template/check_license.sh b/npu/build/build_template/check_license.sh index 1c90310..ddc2aa0 100644 --- a/npu/build/build_template/check_license.sh +++ b/npu/build/build_template/check_license.sh @@ -9,10 +9,18 @@ if [ -z "$XILINXD_LICENSE_FILE" ]; then echo "Please see https://riallto.ai/install-riallto.html for license setup instructions." exit 1 else - # If variable set, see if file exists - if [ ! -e "$XILINXD_LICENSE_FILE" ]; then - echo "The license file $XILINXD_LICENSE_FILE does not exist." - echo "Please see https://riallto.ai/install-riallto.html for license setup instructions." - exit 1 + # Check if XILINXD_LICENSE_FILE is a file + if [ -e "$XILINXD_LICENSE_FILE" ]; then + echo "Found license file: $XILINXD_LICENSE_FILE" + else + # Assume XILINXD_LICENSE_FILE is a server, try to ping + server_address=$(echo $XILINXD_LICENSE_FILE | cut -d@ -f2) + if ping -c 1 $server_address &> /dev/null; then + echo "Server $server_address is reachable." + else + echo "Could not find license file of reach server address $server_address." + echo "Please see https://riallto.ai/install-riallto.html for license setup instructions." + exit 1 + fi fi -fi \ No newline at end of file +fi