chore(home): mirror from kalinamall (9883e6a) with papatramp URLs

This commit is contained in:
2026-07-14 20:43:52 +10:00
commit ed4e78f6c3
312 changed files with 42790 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
#Requires -Version 5.1
<#
.SYNOPSIS
Удалённый sudo на SAC-сервере без интерактивного ввода.
Пароль: Password из ssh-setup/local/kalinamall-sac.conf
#>
[CmdletBinding()]
param(
[string]$HostAlias = 'sac.kalinamall.ru',
[Parameter(Mandatory = $true)]
[string]$RemoteCommand,
[string]$PasswordFile = (Join-Path $HOME 'Projects\Answer.and.other.shit\scripts\ssh-setup\local\kalinamall-sac.conf')
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
function Read-ConfigFile {
param([string]$Path)
$data = @{}
if (-not (Test-Path -LiteralPath $Path)) { throw "Config not found: $Path" }
Get-Content -LiteralPath $Path | ForEach-Object {
if ($_ -match '^([^#=]+)=(.*)$') {
$data[$Matches[1].Trim()] = $Matches[2].Trim()
}
}
return $data
}
$cfg = Read-ConfigFile -Path $PasswordFile
$password = $cfg['Password']
if (-not $password) {
throw "Password not found in $PasswordFile"
}
$inner = $RemoteCommand.Replace("'", "'\\''")
$remote = "sudo -S -p '' bash -lc '$inner'"
$password | & ssh -o BatchMode=yes -o ConnectTimeout=15 $HostAlias $remote