Modified dir name in gitignore and changed disk info example.

This commit is contained in:
Daan Selen
2025-02-28 15:18:57 +01:00
parent f5453353fe
commit f1df522f61
2 changed files with 3 additions and 8 deletions

View File

@@ -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
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 "]"}'