From c7977cd03f142fb0434ff95c7bdf7b16234c57ee Mon Sep 17 00:00:00 2001 From: Mattia Basaglia Date: Sun, 24 May 2015 16:34:14 +0200 Subject: [PATCH] Add Containers --- README | 4 ++++ systempony | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README b/README index 6a94323..bc41d75 100644 --- a/README +++ b/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 ----------------- diff --git a/systempony b/systempony index 158bb63..fb71de8 100755 --- a/systempony +++ b/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"