Deleted even more trailing whitespace, changed an error condition in get_config
This commit is contained in:
parent
0a8a045b29
commit
ba3ee00dca
33
qq2clone
33
qq2clone
|
@ -188,7 +188,7 @@ done
|
|||
{ echo "This script won't run until you install the listed software" >&2;
|
||||
exit "$E_depends"; }
|
||||
|
||||
return 0
|
||||
return 0
|
||||
}
|
||||
#=========================================================================#
|
||||
disp_conf_names ()
|
||||
|
@ -337,13 +337,13 @@ get_config ()
|
|||
[[ -e "$QQ2_DIR/sqlite3" ]] ||
|
||||
{ echo "The sqlite3 binary is missing from $QQ2_DIR";
|
||||
exit "$E_depends"; }
|
||||
|
||||
|
||||
local check
|
||||
read -r check \
|
||||
< <(sqlite3 "select exists ( select * from CONFIG)")
|
||||
((check)) ||
|
||||
{ echo "Is the database corrupt? No CONFIG table!" 2>/dev/null;
|
||||
unexpected_error get_config; }
|
||||
exit "$E_config"; }
|
||||
|
||||
declare -gA OPT
|
||||
declare -a opts
|
||||
|
@ -377,6 +377,7 @@ return 0
|
|||
#---USAGE INFORMATION---#
|
||||
#@@@@@@@@@@@@@@@@@@@@@@@#
|
||||
#-----------------------#
|
||||
|
||||
#=========================================================================#
|
||||
usage ()
|
||||
# DESCRIPTION: Output basic usage information
|
||||
|
@ -1582,7 +1583,7 @@ return 0
|
|||
#---INTERACT WITH VIRSH/VMs---#
|
||||
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
|
||||
#-----------------------------#
|
||||
|
||||
|
||||
#=========================================================================#
|
||||
clone ()
|
||||
# DESCRIPTION: Clone a virtual machine from OPT[TEMPLATE]
|
||||
|
@ -1771,7 +1772,7 @@ fi
|
|||
local virsh_out
|
||||
virsh_out="$(virsh undefine "$uuid" "${undef_args[@]}" 2>&1)" ||
|
||||
{ echo "$virsh_out"; unexpected_error delete_machine; }
|
||||
|
||||
|
||||
sqlite3 "delete from CLONES where id='$1' and \
|
||||
template='${OPT[TEMPLATE]}';"
|
||||
|
||||
|
@ -2056,28 +2057,28 @@ list_states ()
|
|||
if (($#)); then
|
||||
if [[ "$1" == connect ]]; then
|
||||
echo "all"
|
||||
elif [[ "$1" == destroy ]]; then
|
||||
elif [[ "$1" == destroy ]]; then
|
||||
echo "running idle paused in-shutdown pmsuspended"
|
||||
elif [[ "$1" == exec ]]; then
|
||||
echo "all"
|
||||
elif [[ "$1" == restore ]]; then
|
||||
echo "saved"
|
||||
elif [[ "$1" == resume ]]; then
|
||||
echo "paused"
|
||||
elif [[ "$1" == restore ]]; then
|
||||
echo "saved"
|
||||
elif [[ "$1" == resume ]]; then
|
||||
echo "paused"
|
||||
elif [[ "$1" == rm ]]; then
|
||||
echo "all"
|
||||
elif [[ "$1" == rm-wipe ]]; then
|
||||
echo "all"
|
||||
elif [[ "$1" == rm-shred ]]; then
|
||||
echo "all"
|
||||
elif [[ "$1" == save ]]; then
|
||||
elif [[ "$1" == save ]]; then
|
||||
echo "running pmsuspended idle paused paused"
|
||||
elif [[ "$1" == save-rm ]]; then
|
||||
echo "saved"
|
||||
elif [[ "$1" == start ]]; then
|
||||
elif [[ "$1" == start ]]; then
|
||||
echo "off crashed saved"
|
||||
elif [[ "$1" == suspend ]]; then
|
||||
echo "running pmsuspended idle"
|
||||
elif [[ "$1" == suspend ]]; then
|
||||
echo "running pmsuspended idle"
|
||||
fi
|
||||
else
|
||||
echo -n "all crashed idle in-shutdown off paused pmsuspended running"
|
||||
|
@ -2142,7 +2143,7 @@ local prompt="virsh #" # In the virsh shell, input lines start with this
|
|||
[[ -n "${uuid_map["$uuid"]}" ]] &&
|
||||
CL_MAP["${uuid_map["$uuid"]}"]="$uuid"
|
||||
done
|
||||
|
||||
|
||||
local match _uuid
|
||||
for uuid in "${!uuid_map[@]}"; do
|
||||
match=0
|
||||
|
@ -2165,7 +2166,7 @@ for id in "${!CL_MAP[@]}"; do
|
|||
[[ "$line" == "shut off" ]] && line="off"
|
||||
CL_STATE["$id"]="$line"
|
||||
done
|
||||
|
||||
|
||||
echo "domname $uuid" >&3
|
||||
echo "echo EOF" >&3
|
||||
while read -r line <&4; do
|
||||
|
|
Loading…
Reference in New Issue