Попробуйте это,
Я добавляю тень с альфа-1, которая будет действовать как внутренняя граница. И нормальная граница задается как внешняя граница.
yourView.frame = CGRectInset(yourView.frame, -borderWidth, -borderWidth);
yourView.layer.borderColor = [UIColor blackColor].CGColor;
yourView.layer.borderWidth = borderWidth;
yourView.layer.shadowColor = [UIColor whiteColor].CGColor;
yourView.layer.shadowOffset = CGSizeMake(0, 1);
yourView.layer.shadowOpacity = 1;
yourView.layer.shadowRadius = 1.0;
yourView.clipsToBounds = YES;
Просто переместите строку StandardInput ниже, где процесс запущен.
function Start-NewPlinkProcess(
[string]$pfile = 'plink.exe',
[string]$arguments = 'somehost -l somelogin -pw somepasswd ping -c 12 someOtherHost > /home/homeie/mePingTestResults.txt'
){
$p = New-Object System.Diagnostics.Process;
$p.StartInfo.UseShellExecute = $false;
$p.StartInfo.RedirectStandardOutput = $true;
$p.StartInfo.RedirectStandardInput = $true;
$p.StartInfo.FileName = $pfile;
$p.StartInfo.Arguments = $arguments
$pident = ($p.Start()).Id
Write-Host("pid: $($pident)");
$p.StandardInput.WriteLine("Y") # Pass a Y to stdin ignore that...
#$p.WaitForExit();
#$p.StandardOutput.ReadToEnd();
return $p
}
Не надо!
Проверка отпечатка ключа хоста является неотъемлемой частью защиты вашего соединения. Слепое принятие любого ключа хоста сделает вас уязвимым для атак «человек посередине» .
Вместо этого используйте переключатель -hostkey
, чтобы предоставить отпечаток ожидаемого / известного ключа хоста.
[string]$arguments = 'somehost -l somelogin -pw somepasswd ping -hostkey xx:xx:xx:xx:... -c 12 someOtherHost > /home/homeie/mePingTestResults.txt'