getdisk: Add Windows support and fix BSD detection
This commit is contained in:
parent
07b2c83f9a
commit
21a878de5a
7
fetch
7
fetch
|
@ -1009,11 +1009,16 @@ getdisk () {
|
||||||
if type -p df >/dev/null 2>&1; then
|
if type -p df >/dev/null 2>&1; then
|
||||||
# df flags
|
# df flags
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux") df_flags="-h --total" ;;
|
"Linux" | "Windows") df_flags="-h --total" ;;
|
||||||
"Mac OS X") df_flags="-H /" ;;
|
"Mac OS X") df_flags="-H /" ;;
|
||||||
|
|
||||||
|
*"BSD")
|
||||||
|
case "$os" in
|
||||||
"FreeBSD") df_flags="-h -c" ;;
|
"FreeBSD") df_flags="-h -c" ;;
|
||||||
*) disk="Unknown"; return ;;
|
*) disk="Unknown"; return ;;
|
||||||
esac
|
esac
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Get the disk info
|
# Get the disk info
|
||||||
disk=$(df $df_flags 2>/dev/null | awk 'END{print $2 ":" $3 ":" $5}')
|
disk=$(df $df_flags 2>/dev/null | awk 'END{print $2 ":" $3 ":" $5}')
|
||||||
|
|
Reference in New Issue