new script / wrapper around virt-install
This commit is contained in:
14
scripts/system-memory.sh
Executable file
14
scripts/system-memory.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Read the total memory from /proc/meminfo in MiB
|
||||
total_memory=$(awk '/MemTotal/ {print $2}' /proc/meminfo)
|
||||
|
||||
# Convert to MiB by dividing by 1024 (since MemTotal is in KiB)
|
||||
total_memory_mb=$(( total_memory / 1024 ))
|
||||
|
||||
if [[ "$total_memory_mb" -lt "2048" ]]; then
|
||||
echo "Not enough RAM: The system has only ${total_memory_mb}MiB of RAM, but at least 2048 MiB is required."
|
||||
exit 1
|
||||
else
|
||||
echo "Sufficient memory available. System has ${total_memory_mb}MiB of RAM."
|
||||
fi
|
Reference in New Issue
Block a user