Initial commit
This commit is contained in:
24
deploy/check-status.ps1
Normal file
24
deploy/check-status.ps1
Normal file
@@ -0,0 +1,24 @@
|
||||
param(
|
||||
[string]$NasUser = "y2keui",
|
||||
[string]$NasHost = "comtropy.synology.me",
|
||||
[int]$NasPort = 50022,
|
||||
[string]$RemoteDir = "/volume1/docker/telegram-codex-bot",
|
||||
[string]$SshKeyPath = "$env:USERPROFILE\.ssh\nas_codex_ed25519"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$remote = "${NasUser}@${NasHost}"
|
||||
$sshAuthArgs = @()
|
||||
if ($SshKeyPath -and (Test-Path $SshKeyPath)) {
|
||||
$sshAuthArgs = @("-i", $SshKeyPath, "-o", "IdentitiesOnly=yes")
|
||||
}
|
||||
$remoteCommand = @"
|
||||
export PATH=/usr/local/bin:/var/packages/ContainerManager/target/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
|
||||
cd '$RemoteDir'
|
||||
sudo /usr/local/bin/docker-compose ps
|
||||
echo '--- logs ---'
|
||||
sudo /usr/local/bin/docker-compose logs --tail=160 telegram-codex-bot
|
||||
"@
|
||||
|
||||
ssh @sshAuthArgs -tt -p $NasPort $remote $remoteCommand
|
||||
Reference in New Issue
Block a user