加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
zkj_install_k记饭店_linux主控机.ps1 1.97 KB
一键复制 编辑 原始数据 按行查看 历史
chuanjiao10 提交于 2020-11-29 14:47 . 更新git库
#建议保存编码为:bom头 + utf8
#Requires -RunAsAdministrator
#此脚本只能在主控机上运行。
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
& '/etc/kasini3000/0k_source.ps1'
if ($IsLinux -eq $True)
{
$username = /usr/bin/whoami
if ($username -ne 'root')
{
Write-Error '非管理员'
Exit 1
}
if ([System.Environment]::Is64BitOperatingSystem -eq $True)
{
}
else
{
Write-Error '不支持32位操作系统!'
Exit 2
}
$判断centos6 = @'
rpm -q centos-release
'@ | /usr/bin/bash
if ( $判断centos6.contains('el6'.tolower()) )
{
Write-Error '不支持centos6'
Exit 3
}
if (Test-Path '/etc/kasini3000')
{
}
else
{
Write-Error '找不到 /etc/kasini3000'
Exit 4
}
Write-Warning '安装ps依赖库。'
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
& '/usr/bin/pwsh' -c 'Install-Module -Name powershell-yaml'
& '/usr/bin/pwsh' -c 'Install-Module -Name PoshRSJob'
& '/usr/bin/pwsh' -c 'Install-Module -Name ImportExcel'
Write-Warning '安装linux依赖库。'
& 'bkj_install_linuxpackage.ps1' epel-release
& 'bkj_install_linuxpackage.ps1' ntpdate
& 'bkj_install_linuxpackage.ps1' fuse-sshfs
& 'bkj_install_linuxpackage.ps1' sshfs
& 'bkj_install_linuxpackage.ps1' git
& 'bkj_install_linuxpackage.ps1' sshpass
& 'bkj_install_linuxpackage.ps1' openssh-clients
Write-Warning '安装sqlite'
Copy-Item -LiteralPath '/etc/kasini3000/cmdb/linux.SQLite.Interop.dll' -Destination '/etc/kasini3000/cmdb/SQLite.Interop.dll' -Force
Write-Warning '安装 k_crontab'
& 'u库定时任务_建立任务计划_linux.ps1'
Write-Warning '在/usr/bin创建快捷方式。'
chmod u+x /etc/kasini3000/kc.sh
ln -s /etc/kasini3000/kc.sh /usr/bin/kc
chmod u+x /etc/kasini3000/kcp.sh
ln -s /etc/kasini3000/kcp.sh /usr/bin/kcp
Write-Warning '检查ssh公钥文件。'
& 'gx更新主控机上的_双公钥文件authorized_keys.ps1'
}
Write-Host -ForegroundColor green 'kasini3000,安装完成!'
exit 0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化