mirror of
https://gitlab.com/mattia.basaglia/ASCII-Pony.git
synced 2024-11-22 04:07:59 +01:00
Add Containers
This commit is contained in:
parent
62ac481c37
commit
c7977cd03f
2 changed files with 17 additions and 1 deletions
4
README
4
README
|
@ -37,6 +37,10 @@ Config Variables:
|
|||
* FSTYPE : file system type used to calculate disk usage (Uses df),
|
||||
if empty it will show the total.
|
||||
|
||||
Requirements:
|
||||
* lsb-release for Dirstro
|
||||
* lxc for Containers
|
||||
|
||||
Generating Images
|
||||
-----------------
|
||||
|
||||
|
|
14
systempony
14
systempony
|
@ -4,7 +4,7 @@
|
|||
# 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 Load Shell Packages RAM Disk)
|
||||
INFO=(User Hostname Distro Kernel Uptime Load Shell Packages RAM Disk)
|
||||
# File system type to show disk usage (default/empty=all) (see df for specific values)
|
||||
FSTYPE=
|
||||
|
||||
|
@ -103,6 +103,18 @@ function ponyget_Disk()
|
|||
echo -e "$(pccolor $percent)$used\x1b[0m / $total"
|
||||
}
|
||||
|
||||
function ponyget_Containers()
|
||||
{
|
||||
local active="$(lxc-ls --active | wc -l)"
|
||||
local total="$(lxc-ls | wc -l)"
|
||||
local color=32
|
||||
if [ "$active" -lt "$total" ]
|
||||
then
|
||||
color=31
|
||||
fi
|
||||
echo -e "\x1b[$color;1m$active\x1b[0m / $total active"
|
||||
}
|
||||
|
||||
function bold()
|
||||
{
|
||||
echo -en "\x1b[1m${*}\x1b[22m"
|
||||
|
|
Loading…
Reference in a new issue