Simplify stat commands and fix bridge interface listing

This commit is contained in:
Matt Churchyard
2018-06-26 10:16:21 +00:00
parent ab73130132
commit 152cb92250
2 changed files with 3 additions and 3 deletions

View File

@@ -31,7 +31,7 @@
#
info::guest(){
local _name="$1"
local _bridge_list=$(ifconfig | grep ^bridge | cut -d: -f1)
local _bridge_list=$(ifconfig -g bridge)
local _ds
vm::running_load
@@ -304,7 +304,7 @@ info::guest_disks(){
if [ -n "${_path}" ]; then
case "${_dev}" in
file)
_size=$(stat "${_path}" | cut -d' ' -f8)
_size=$(stat -f%z "${_path}")
_used=$(du "${_path}" | awk '{print $1}')
_used=$((_used * 1024))
;;

View File

@@ -243,7 +243,7 @@ util::log_rotate(){
esac
if [ -e "${_file}" ]; then
_size=$(stat "${_file}" | cut -d' ' -f8)
_size=$(stat -f %z "${_file}")
if [ -n "${_size}" -a "${_size}" -ge 1048576 ]; then
unlink "${_file}.0.gz" >/dev/null 2>&1