#!/usr/bin/perl #$term='xterm -e '; $term='ya-session --run +'; push @u,('root'); push @u,($ENV{'USER'}) if($ENV{'USER'} ne 'root'); sub _open{ my $f="$ENV{HOME}/$_[0]"; open(F,'<',$f) && return 1; die $! if(-e $f); 0; } print ""; for my $u (@u){ _open('.ssh/known_hosts') || last; $#u && print ""; while(defined(my $s=)){ my @h=split(/[, ]/,$s,2); $h=$h[0] if(!(($h,$p)=$h[0]=~/^\[(.+)\]:([0-9]+)/)); ($h1,$h2)=defined($p)?("$h:$p","$h -p $p"):($h,$h); print "${term}ssh -l $u $h2"; } close(F); $#u && print ''; } if(_open('.config/freerdp/known_hosts2')){ print ""; while(defined(my $s=)){ my @h=split(/\s+/,$s); my $h=$h[0]; $h.=":$h[1]" if($h[1] ne 3389); print "${term}xfreerdp /bpp:8 /compression-level:2 /admin +sec-ext -themes -wallpaper +fonts /nsc /jpeg /v:$h\n"; } close(F); print ''; } print '';