From f1df522f619aed0ddeaaf97160aa8a4c833ec552 Mon Sep 17 00:00:00 2001 From: Daan Selen Date: Fri, 28 Feb 2025 15:18:57 +0100 Subject: [PATCH] Modified dir name in gitignore and changed disk info example. --- .gitignore | 2 +- examples/linux/disk_info.yaml | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index ec79565..3771c16 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ *.conf venv -meshbooks +books .vscode # Byte-compiled / optimized / DLL files diff --git a/examples/linux/disk_info.yaml b/examples/linux/disk_info.yaml index e90cb7f..e75cf0a 100644 --- a/examples/linux/disk_info.yaml +++ b/examples/linux/disk_info.yaml @@ -1,13 +1,8 @@ --- name: Use DF to get drive information in JSON. -groups: Placeholder +group: Systemec Development target_os: "Linux" tasks: - name: Get disk-info with df returning JSON. command: > - df -Th -x overlay -x tmpfs -x devtmpfs | \ - awk 'NR==1 || $1 ~ ".+"{print $3, $4, $5, $7, $2}' | \ - awk 'NR>1 {printf "{\"size\":\"%s\",\"used\":\"%s\",\"available\":\"%s\",\"mount_point\":\"%s\",\"type\":\"%s\"},", $1, $2, $3, $4, $5}' | \ - sed '$ s/,$//' | \ - awk 'BEGIN {printf "["} {printf "%s", $0} END {printf "]"}' - exit \ No newline at end of file + df -Th -x overlay -x tmpfs -x devtmpfs | awk 'NR>1 {printf "%s{\"size\":\"%s\",\"used\":\"%s\",\"available\":\"%s\",\"mount_point\":\"%s\",\"type\":\"%s\"}", (NR==2?"[":","), $3, $4, $5, $7, $2} END {print "]"}' \ No newline at end of file