1 Star 0 Fork 51

sunguilou / project_10215868

forked from chuanjiao10 / kasini3000 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
zkj_从主控机到linux被控机_ssh_knowhost免yes.ps1 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
chuanjiao10 提交于 2019-12-04 00:21 . 建立目录结构
#建议保存编码为:bom头 + utf8
if ( ($IsWindows -eq $True) -or ($PSVersionTable.psversion.major -lt 6) ) #win
{
& 'c:\ProgramData\kasini3000\0k_source.ps1'
}
if ($IsLinux -eq $True)
{
& '/etc/kasini3000/0k_source.ps1'
}
if ( ($IsWindows -eq $True) -or ($PSVersionTable.psversion.major -lt 6) ) #win
{
if (Test-Path -LiteralPath "$env:USERPROFILE\.ssh\config")
{
}
else
{
New-Item -Path "$env:USERPROFILE\.ssh\config"
}
if (Select-String -Pattern 'StrictHostKeyChecking' -LiteralPath "$env:USERPROFILE\.ssh\config" -SimpleMatch -Quiet)
{
}
else
{
Add-Content -LiteralPath "$env:USERPROFILE\.ssh\config" -Value "StrictHostKeyChecking no" -Encoding Ascii
}
}
if ($IsLinux -eq $True)
{
if (Test-Path -LiteralPath '/root/.ssh/config')
{
}
else
{
New-Item -Path '/root/.ssh/config'
}
if (Select-String -Pattern 'StrictHostKeyChecking' -LiteralPath '/root/.ssh/config' -SimpleMatch -Quiet)
{
}
else
{
Add-Content -LiteralPath '/root/.ssh/config' -Value "StrictHostKeyChecking no" -Encoding Ascii
}
}
exit 0
PowerShell
1
https://gitee.com/sunguilou/kasini3000.git
git@gitee.com:sunguilou/kasini3000.git
sunguilou
kasini3000
project_10215868
master

搜索帮助