mirror of
https://github.com/tteck/Proxmox.git
synced 2024-11-24 05:25:30 +00:00
Update fstrim.sh
display CTID instead of hostname
This commit is contained in:
parent
b7bfe7df14
commit
b082f8a08e
@ -44,9 +44,8 @@ excluded_containers=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "
|
||||
|
||||
function trim_container() {
|
||||
local container=$1
|
||||
local name=$(pct exec "$container" hostname 2>/dev/null || echo "No hostname because the container is not running")
|
||||
header_info
|
||||
echo -e "${BL}[Info]${GN} Trimming ${name} ${CL} \n"
|
||||
echo -e "${BL}[Info]${GN} Trimming ${container} ${CL} \n"
|
||||
local before_trim=$(lvs | awk -F '[[:space:]]+' 'NR>1 && (/Data%|'"vm-$container"'/) {gsub(/%/, "", $7); print $7}')
|
||||
echo -e "${RD}Data before trim $before_trim%${CL}"
|
||||
pct fstrim $container
|
||||
@ -66,7 +65,7 @@ for container in $(pct list | awk '{if(NR>1) print $1}'); do
|
||||
template=$(pct config $container | grep -q "template:" && echo "true" || echo "false")
|
||||
if [ "$template" == "true" ]; then
|
||||
header_info
|
||||
echo -e "${BL}[Info]${GN} Skipping ${name} ${RD}$container is a template ${CL} \n"
|
||||
echo -e "${BL}[Info]${GN} Skipping ${container} ${RD}$container is a template ${CL} \n"
|
||||
sleep 1
|
||||
continue
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user