Слияние кода завершено, страница обновится автоматически
# 不支持 centos 9 stream
[scriptblock]$private:判断linux发行版 =
{
#---------------主---------------
if (Select-String -Pattern 'AlmaLinux release 9' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'AlmaLinux 9'
}
if (Select-String -Pattern 'Rocky Linux release 9' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'Rocky Linux 9'
}
if (Select-String -Pattern 'Oracle Linux Server 9' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'Oracle Linux 9'
}
if (Select-String -Pattern 'Red Hat Enterprise Linux 9' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'RHEL9'
}
if (Select-String -Pattern 'centos-8' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'centos8'
}
if (Select-String -Pattern 'AlmaLinux release 8' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'AlmaLinux 8'
}
if (Select-String -Pattern 'Rocky Linux release 8' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'Rocky Linux 8'
}
if (Select-String -Pattern 'Jammy Jellyfish' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'ubuntu2204'
}
if (Select-String -Pattern 'Noble Numbat' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'ubuntu2404'
}
if (Select-String -Pattern 'bullseye' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'debian11'
}
if (Select-String -Pattern 'bookworm' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'debian12'
}
if (Select-String -Pattern 'Amazon Linux 2023' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'Amazon Linux 2023'
}
if (Select-String -Pattern 'Oracle Linux Server 8' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'Oracle Linux 8'
}
if (Select-String -Pattern 'FreeBSD 14' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'FreeBSD14'
}
if (Select-String -Pattern 'FreeBSD 13' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'FreeBSD13'
}
#---------------未来---------------
if (Select-String -Pattern 'trixie' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'debian13'
}
if (Select-String -Pattern 'forky' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'debian14'
}
if (Select-String -Pattern 'FreeBSD 15' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'FreeBSD15'
}
if (Select-String -Pattern 'FreeBSD 16' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'FreeBSD16'
}
if (Select-String -Pattern 'Noble Numbat123' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'ubuntu2604'
}
#---------------国主---------------
if (Select-String -Pattern 'openEuler 22.03' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'openEuler22.03'
}
if (Select-String -Pattern 'openEuler 24.03' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'openEuler24.03'
}
if (Select-String -Pattern 'UOS Server Enterprise-C' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return '统信UOS服务器版'
}
if (Select-String -Pattern 'Anolis OS 8' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return '龙蜥8'
}
if (Select-String -Pattern 'Soaring Falcon' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'Alibaba Cloud Linux 3'
}
#---------------旧---------------
if (Select-String -Pattern 'openEuler 20.03' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'openEuler20.03'
}
if (Select-String -Pattern 'Tercel' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'kylin v10'
}
if (Select-String -Pattern 'Hunting Beagle' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'Alibaba Cloud Linux 2'
}
if (Select-String -Pattern 'Focal Fossa' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'ubuntu2004'
}
#---------------老旧---------------
if (Select-String -Pattern 'buster' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'debian10'
}
if (Select-String -Pattern 'stretch' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'debian9'
}
if (Select-String -Pattern 'Bionic Beaver' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'ubuntu1804'
}
if (Select-String -Pattern 'Xenial Xerus' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'ubuntu1604'
}
if (Select-String -Pattern 'centos-7' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'centos7'
}
if (Select-String -Pattern 'Amazon Linux 2' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'Amazon Linux 2'
}
#---------------非主流---------------
if (Select-String -Pattern 'Alpine' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'Alpine'
}
if (Select-String -Pattern 'CBL-Mariner' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'MS-CBL-Mariner2'
}
if (Select-String -Pattern 'Microsoft Azure Linux 3' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'Azure-Linux3'
}
if (Select-String -Pattern 'OpenCloudOS 8' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'TencentOpenCloudOS8'
}
if (Select-String -Pattern 'OpenCloudOS 9' -Path '/etc/*-release' -SimpleMatch -Quiet)
{
return 'TencentOpenCloudOS9'
}
#---------------temp---------------
#if (Select-String -Pattern 'forky' -Path '/etc/*-release' -SimpleMatch -Quiet)
#{
#return 'debian14'
#}
# if (Select-String -Pattern 'jessie' -Path '/etc/*-release' -SimpleMatch -Quiet)
# {
# return 'debian8'
# }
return '未知'
}
return $private:判断linux发行版
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )