39 Star 220 Fork 51

chuanjiao10 / kasini3000

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
zkj_install_k记饭店_linux主控机.ps1 2.06 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史
chuanjiao10 提交于 2023-07-15 14:05 . 本软件开源4周年啦!
#Requires -RunAsAdministrator
# 此脚本只能在主控机上运行。
# arm cpu ,or raspberry ,see: docs\install_kasini3000master_to_raspberry.md
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls13,[System.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
PowerShell
1
https://gitee.com/chuanjiao10/kasini3000.git
git@gitee.com:chuanjiao10/kasini3000.git
chuanjiao10
kasini3000
kasini3000
master

搜索帮助

14c37bed 8189591 565d56ea 8189591