Updated Manager.ps1 - more Linux support, still Work In Progress.
This commit is contained in:
parent
bd9d97f6d8
commit
4e06e4e496
1 changed files with 84 additions and 58 deletions
28
Manager.ps1
28
Manager.ps1
|
@ -58,6 +58,8 @@ function check_software ($app)
|
|||
}
|
||||
}
|
||||
function check_ram ($in)
|
||||
{
|
||||
if ($IsWindows)
|
||||
{
|
||||
$total = (Get-CimInstance Win32_PhysicalMemory | Measure-Object -Property capacity -Sum).sum /1gb
|
||||
|
||||
|
@ -71,6 +73,16 @@ function check_ram ($in)
|
|||
error "$in GB RAM detected. You need at least 3 GB."
|
||||
}
|
||||
}
|
||||
elseif ($IsLinux)
|
||||
{
|
||||
$total = $(awk '{ print $2 }' /proc/meminfo | head -n1) / 1024 / 1024
|
||||
|
||||
if ($total -lt 2.79369)
|
||||
{
|
||||
error "Not enough RAM installed. You need AT LEAST 3GB."
|
||||
}
|
||||
}
|
||||
}
|
||||
function check_arch
|
||||
{
|
||||
$arch = (Get-CimInstance CIM_OperatingSystem).OSArchitecture
|
||||
|
@ -217,6 +229,8 @@ check_ram(3) # argument is amount of (required) RAM in GB.
|
|||
check_arch
|
||||
check_os
|
||||
|
||||
if ($IsWindows)
|
||||
{
|
||||
if ($check -eq 6)
|
||||
{
|
||||
Write-Host "Cloning Longvinter Windows Server repository..."
|
||||
|
@ -274,6 +288,18 @@ ChestRespawnTime=600"
|
|||
}
|
||||
else
|
||||
{
|
||||
Write-Host "One or more checks failed. Cannot install Longvinter Server."
|
||||
Write-Host "One or more checks failed. Cannot install Longvinter (Windows) Server."
|
||||
Exit
|
||||
}
|
||||
}
|
||||
elseif ($IsLinux)
|
||||
{
|
||||
if ((id -u) -eq 0)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
error "Please run the script as root."
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue