Skip to content

Commit f1df522

Browse files
committed
Modified dir name in gitignore and changed disk info example.
1 parent f545335 commit f1df522

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
*.conf
22
venv
3-
meshbooks
3+
books
44
.vscode
55

66
# Byte-compiled / optimized / DLL files

examples/linux/disk_info.yaml

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
---
22
name: Use DF to get drive information in JSON.
3-
groups: Placeholder
3+
group: Systemec Development
44
target_os: "Linux"
55
tasks:
66
- name: Get disk-info with df returning JSON.
77
command: >
8-
df -Th -x overlay -x tmpfs -x devtmpfs | \
9-
awk 'NR==1 || $1 ~ ".+"{print $3, $4, $5, $7, $2}' | \
10-
awk 'NR>1 {printf "{\"size\":\"%s\",\"used\":\"%s\",\"available\":\"%s\",\"mount_point\":\"%s\",\"type\":\"%s\"},", $1, $2, $3, $4, $5}' | \
11-
sed '$ s/,$//' | \
12-
awk 'BEGIN {printf "["} {printf "%s", $0} END {printf "]"}'
13-
exit
8+
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 "]"}'

0 commit comments

Comments
 (0)