mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-22 07:16:43 +02:00
add error scenarios
This commit is contained in:
@@ -309,8 +309,10 @@ if [ "$1" = "status" ]; then
|
|||||||
# remove the storage device from the list
|
# remove the storage device from the list
|
||||||
listOfDevices=$(echo "${listOfDevices}" | grep -v "${storageDevice}")
|
listOfDevices=$(echo "${listOfDevices}" | grep -v "${storageDevice}")
|
||||||
|
|
||||||
# ech error on VM if system was biggest/only drive
|
# no storage device found
|
||||||
if [ "${systemDevice}" = "${storageDevice}" ]; then
|
if [ "${systemDevice}" = "${storageDevice}" ]; then
|
||||||
|
echo "# ERROR: no free storage found"
|
||||||
|
scenario="error:no-storage"
|
||||||
storageDevice=""
|
storageDevice=""
|
||||||
storageSizeGB=""
|
storageSizeGB=""
|
||||||
|
|
||||||
@@ -369,6 +371,11 @@ if [ "$1" = "status" ]; then
|
|||||||
dataDevice=$(echo "${listOfDevices}" | head -n1 | awk '{print $1}')
|
dataDevice=$(echo "${listOfDevices}" | head -n1 | awk '{print $1}')
|
||||||
dataSizeGB=$(echo "${listOfDevices}" | head -n1 | awk '{print $2}')
|
dataSizeGB=$(echo "${listOfDevices}" | head -n1 | awk '{print $2}')
|
||||||
|
|
||||||
|
# when data drive but no storage
|
||||||
|
if [ ${#storageDevice} -eq 0 ]; then
|
||||||
|
echo "# ERROR: data drive but no storage"
|
||||||
|
scenario="error:system-bigger-than-storage"
|
||||||
|
|
||||||
# if there is was no spereated data drive - run combine data & storage partiton
|
# if there is was no spereated data drive - run combine data & storage partiton
|
||||||
if [ ${#dataDevice} -eq 0 ]; then
|
if [ ${#dataDevice} -eq 0 ]; then
|
||||||
combinedDataStorage=1
|
combinedDataStorage=1
|
||||||
@@ -459,15 +466,17 @@ if [ "$1" = "status" ]; then
|
|||||||
|
|
||||||
#################
|
#################
|
||||||
# Define Scenario
|
# Define Scenario
|
||||||
scenario="unknown"
|
|
||||||
|
|
||||||
# migration: detected data from another node implementation
|
# migration: detected data from another node implementation
|
||||||
if [ ${#storageMigration} -gt 0 ]; then
|
if [ ${#scenario} -gt 0 ]; then
|
||||||
|
echo "# scenario already set by analysis above to: ${scenario}"
|
||||||
|
|
||||||
|
elif [ ${#storageMigration} -gt 0 ]; then
|
||||||
scenario="migration"
|
scenario="migration"
|
||||||
|
|
||||||
# nodata: no drives >64GB connected
|
# nodata: no drives >64GB connected
|
||||||
elif [ ${#storageDevice} -eq 0 ]; then
|
elif [ ${#storageDevice} -eq 0 ]; then
|
||||||
scenario="no-storage"
|
scenario="error:no-storage"
|
||||||
|
|
||||||
# ready: Proxmox VM with all seperated drives mounted
|
# ready: Proxmox VM with all seperated drives mounted
|
||||||
elif [ ${#storageMountedPath} -gt 0 ] && [ ${#dataMountedPath} -gt 0 ] && [ ${#systemMountedPath} -gt 0 ]; then
|
elif [ ${#storageMountedPath} -gt 0 ] && [ ${#dataMountedPath} -gt 0 ] && [ ${#systemMountedPath} -gt 0 ]; then
|
||||||
|
Reference in New Issue
Block a user