Changeset 2043 in ProjectBuilder
- Timestamp:
- Feb 19, 2016, 2:45:06 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
0.13.2/pb/bin/pb
r2042 r2043 4935 4935 close(FILE); 4936 4936 my $key = "\Q$zero1"; 4937 4938 pb_system("ssh -q -o UserKnownHostsFile=/dev/null -p $nport -i $keyfile root\@$vmhost->{$ENV{'PBPROJ'}} ".'perl -e \'my $file1="$ENV{\'HOME\'}/.ssh/authorized_keys"; open(PBFILE,$file1) || die "Unable to open $file1"; open(PBOUT,"> $file1.new") || die "Unable to open $file1.new"; my $count = 0; while (<PBFILE>) { '."if (/ $key /) { \$count++; } print PBOUT \$_ if ((\$count <= 1) || (\$_ !~ / $key /)); };".'close(PBFILE); close(PBOUT); rename("$file1.new",$file1); chmod 0600,$file1;\'',"","quiet"); 4937 my $perls = "$ENV{'PBTMP'}/perls.$$"; 4938 4939 open(FILE,"> $perls") || die "Unable to open $perls"; 4940 print FILE << 'EOF'; 4941 my $file1="$ENV{'HOME'}/.ssh/authorized_keys"; 4942 open(PBFILE,$file1) || die "Unable to open $file1"; 4943 open(PBOUT,"> $file1.new") || die "Unable to open $file1.new"; 4944 my $count = 0; 4945 while (<PBFILE>) { 4946 EOF 4947 print FILE << "EOF"; 4948 if (/ $key /) { 4949 \$count++; 4950 } 4951 print PBOUT \$_ if ((\$count <= 1) || (\$_ !~ / $key /)); 4952 } 4953 close(PBFILE); 4954 close(PBOUT); 4955 rename("\$file1.new",\$file1); 4956 chmod 0600,\$file1; 4957 EOF 4958 close(FILE); 4959 pb_system("cat $perls | ssh -q -o UserKnownHostsFile=/dev/null -p $nport -i $keyfile root\@$vmhost->{$ENV{'PBPROJ'}} perl","","quiet"); 4939 4960 return; 4940 4961 }
Note:
See TracChangeset
for help on using the changeset viewer.