mirror of
https://github.com/churchers/vm-bhyve.git
synced 2026-01-06 04:54:36 +01:00
Simplify stat commands and fix bridge interface listing
This commit is contained in:
@@ -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))
|
||||
;;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user