mirror of
https://github.com/DaanSelen/meshbook.git
synced 2026-02-20 16:32:11 +00:00
Modified dir name in gitignore and changed disk info example.
This commit is contained in:
@@ -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 "]"}'
|
||||
Reference in New Issue
Block a user