Changeset 5e71d34
- Timestamp:
- Jan 18, 2013 10:06:54 AM (12 years ago)
- Branches:
- master
- Children:
- 8f654de
- Parents:
- 950b55e
- Location:
- fedkit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/gateway_lib.pm
r950b55e r5e71d34 44 44 $t = new File::Temp() || die "Can't open tempfile: $!\n"; 45 45 46 # If the parameter is in the file (even in a comment) update the line to 47 # have the new parameter. 48 my %updated; 46 49 while (<$f>) { 47 50 foreach my $k (keys %{$keys}) { 48 s/^\s*#?\s*$k.*/$k $keys->{$k}/;51 if (s/^\s*#?\s*$k.*/$k $keys->{$k}/) { $updated{$k}++; } 49 52 } 50 53 print $t $_; 54 } 55 # Any parameters not found above are output directly. 56 foreach my $k (keys %{$keys}) { 57 print $t "$k " . $keys->{$k} . "\n" unless $updated{$k}; 51 58 } 52 59 $f->close(); -
fedkit/prep_gateway.pl
r950b55e r5e71d34 40 40 gateway_lib::set_sshd_params( 41 41 { 'GatewayPorts' => 'yes', 'PermitTunnel' => 'yes' } ); 42 system("/etc/init.d/sshd restart"); 42 if ( -x "/etc/init.d/sshd") { 43 system("/etc/init.d/sshd restart"); 44 } 45 elsif (-x "/etc/init.d/ssh") { 46 # XXX should look for service 47 system("/etc/init.d/ssh restart"); 48 } 49 else { 50 print "Cannot figure out how to restart sshd\n"; 51 } 43 52 gateway_lib::import_key($ssh_pubkey,'/root/.ssh/authorized_keys') 44 53 if $ssh_pubkey;
Note: See TracChangeset
for help on using the changeset viewer.