From ff06e23cee0023ec4de1816e67b0dbf9a1db0ff6 Mon Sep 17 00:00:00 2001 From: manegron Date: Wed, 4 Mar 2026 15:19:18 +0000 Subject: [PATCH] Remove script to create assets type --- resources/bin/rb_create_asset_type_yaml.sh | 62 ---------------------- 1 file changed, 62 deletions(-) delete mode 100755 resources/bin/rb_create_asset_type_yaml.sh diff --git a/resources/bin/rb_create_asset_type_yaml.sh b/resources/bin/rb_create_asset_type_yaml.sh deleted file mode 100755 index 41ec4d60..00000000 --- a/resources/bin/rb_create_asset_type_yaml.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -# ================================ -# Script to generate a YAML file mapping MAC → asset type name from PostgreSQL -# Usage: -# ./rb_create_asset_type_yaml.sh [output_file] -# ./rb_create_asset_type_yaml.sh -h -# ================================ - -# Show help -if [[ "$1" == "-h" || "$1" == "--help" ]]; then - cat <&1) -if [ $? -ne 0 ]; then - echo "Error executing SQL query:" - echo "$QUERY_RESULT" - exit 1 -fi - -# Good luck understanding this awk command -echo "$QUERY_RESULT" | awk -v outfile="$OUTPUT_FILE" ' -BEGIN { print "---" > outfile } -/^[[:space:]]*([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}/ { - gsub(/^[[:space:]]+|[[:space:]]+$/, "", $0); # trim - split($0, arr, "|"); - mac=arr[1]; gsub(/^[ \t]+|[ \t]+$/, "", mac); - id=arr[2]; gsub(/^[ \t]+|[ \t]+$/, "", id); - printf "\"%s\": \"%s\"\n", mac, id >> outfile -} -' -if [ $? -ne 0 ]; then - echo "Error processing output of the YAML." - exit 1 -fi - -echo "File generated: $OUTPUT_FILE" -exit 0 -