Disk [HP-UX]: Add initial support

This commit is contained in:
Muhammad Herdiansyah 2017-07-04 19:51:28 +07:00
parent 9b51f9f528
commit 7dac8843f1

View file

@ -1917,7 +1917,10 @@ get_disk() {
# Create an array called 'disks' where each element is a separate line from # Create an array called 'disks' where each element is a separate line from
# df's output. We then unset the first element which removes the column titles. # df's output. We then unset the first element which removes the column titles.
IFS=$'\n' IFS=$'\n'
disks=($(df "${df_flags[@]}" "${disk_show[@]:-/}" 2>/dev/null)) case "$os" in
"HP-UX") disks=($(bdf "${disk_show[@]:-/}" 2>/dev/null)); df_version="bdf" ;;
*) disks=($(df "${df_flags[@]}" "${disk_show[@]:-/}" 2>/dev/null)) ;;
esac
unset 'disks[0]' unset 'disks[0]'
IFS="$old_ifs" IFS="$old_ifs"
@ -1931,7 +1934,7 @@ get_disk() {
disk_perc="${disk_info[4]/'%'}" disk_perc="${disk_info[4]/'%'}"
case "$df_version" in case "$df_version" in
*"befhikm"*) disk="$((disk_info[2]/1024/1024))G / $((disk_info[1]/1024/1024))G (${disk_perc}%)" ;; *"befhikm"*|"bdf") disk="$((disk_info[2]/1024/1024))G / $((disk_info[1]/1024/1024))G (${disk_perc}%)" ;;
*) disk="${disk_info[2]/i} / ${disk_info[1]/i} (${disk_perc}%)" ;; *) disk="${disk_info[2]/i} / ${disk_info[1]/i} (${disk_perc}%)" ;;
esac esac