54 lines
1.0 KiB
Plaintext
54 lines
1.0 KiB
Plaintext
![]() |
#!/bin/bash
|
||
|
|
||
|
#
|
||
|
# dialog helper
|
||
|
#
|
||
|
|
||
|
dh()
|
||
|
{
|
||
|
local bgtitle="kvm-tools $version | $1"
|
||
|
|
||
|
if [ $2 = "--inputbox" ]; then
|
||
|
local size="7 80"
|
||
|
elif [ $2 = "--yesno" ]; then
|
||
|
local size="20 80"
|
||
|
elif [ $2 = "--fselect" ]; then
|
||
|
local size="12 80"
|
||
|
else
|
||
|
local size="20 80 14"
|
||
|
fi
|
||
|
|
||
|
dialog --backtitle "$bgtitle" --no-cancel "$2" "$3" $size $4 2> /tmp/dialog
|
||
|
local returncode=$?
|
||
|
clear
|
||
|
dialogresult=$(cat /tmp/dialog)
|
||
|
rm /tmp/dialog
|
||
|
return $returncode
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
# this is still needed by kvm-tools
|
||
|
graph()
|
||
|
{
|
||
|
local bgtitle="kvm-tools $version | $1"
|
||
|
|
||
|
if [ $2 = "--inputbox" ]; then
|
||
|
local size="7 80"
|
||
|
elif [ $2 = "--yesno" ]; then
|
||
|
local size="20 80"
|
||
|
elif [ $2 = "--fselect" ]; then
|
||
|
local size="12 80"
|
||
|
else
|
||
|
local size="20 80 14"
|
||
|
fi
|
||
|
|
||
|
dialog --backtitle "$bgtitle" --no-cancel "$2" "$3" $size $4 2> /tmp/dialog
|
||
|
local returncode=$?
|
||
|
clear
|
||
|
dialogresult=$(cat /tmp/dialog)
|
||
|
rm /tmp/dialog
|
||
|
return $returncode
|
||
|
|
||
|
}
|