mirror of
https://gitlab.com/mattia.basaglia/ASCII-Pony.git
synced 2024-11-21 19:57:59 +01:00
Option to choose filesystem type
This commit is contained in:
parent
987a3f6abb
commit
206b6cc9da
1 changed files with 8 additions and 1 deletions
|
@ -1,7 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
# These global variables can be overridden by config
|
||||
# Name of the pony
|
||||
PONY=random
|
||||
# What info to show (must have a function defined as ponyget_* to work)
|
||||
INFO=( User Hostname Distro Kernel Uptime Shell Packages RAM Disk )
|
||||
# File system type to show disk usage (default/empty=all) (see df for specific values)
|
||||
FSTYPE=
|
||||
|
||||
function ponyget_Shell()
|
||||
{
|
||||
|
@ -82,7 +87,9 @@ function ponyget_Packages()
|
|||
|
||||
function ponyget_Disk()
|
||||
{
|
||||
local diskusage=$(df -lh --total | tail -n 1 | sed -r "s/ +/\t/g" )
|
||||
local dfoption=$FSTYPE
|
||||
[ "$dfoption" ] && dfoption="-t $FSTYPE"
|
||||
local diskusage=$(df -lh $dfoption --total | tail -n 1 | sed -r "s/ +/\t/g" )
|
||||
local used=$(echo "$diskusage" | cut -f 3)
|
||||
local total=$(echo "$diskusage" | cut -f 2)
|
||||
local percent=$(echo "$diskusage" | cut -f 5 | sed s/%// )
|
||||
|
|
Loading…
Reference in a new issue