testuser Authentication-Type = Unix-PW User-Service = Framed-user, Ascend-Idle-Limit = 600, Framed-Protocol = PPP, Framed-Address = 222.222.222.222, Framed-Netmask = 255.255.255.255, Ascend-Route-IP = Route-IP-Yes, Ascend-Metric = 3 test2user Password = "Testpassword" Framed-Protocol = PPP, Ascend-Idle-Limit = 600 #### #!/usr/bin/perl -w # # ##################################################################### use strict; open (FILE,"){ next if /^#/; chomp; if($_ =~ /^\w/){ m/(.*)(Password = |Authentication-Type = )(.*)/; ($login,$password) = ($1,$3); $login =~ s/\s+$//; $password =~ s/\"//g; }elsif($_ =~ /^\s/){ if($_ =~ /(User-Service = )(.*)(,)/){ $user_service = $2; } if($_ =~ /(Framed-Protocol = )(.*)(,)/){ $framed_protocol = $2; } if($_ =~ /(Framed-Address = )(.*)(,)/){ $framed_address = $2; } if($_ =~ /(Framed-Netmask = )(.*)(,)/){ $framed_netmask = $2; } if($_ =~ /(Ascend-Route-IP = )(.*)(,)/){ $ascend_route_IP = $2; } if($_ =~ /(Ascend-Metric = )(.*)(,)/){ $ascend_metric = $2; } if($_ =~ /(Ascend-Idle-Limit = )(.*)(,)/){ $ascend_idle_limit = $2; } } print "$login:$password\n"; print "$user_service\n"; print "$framed_protocol\n"; print "$framed_address\n"; print "$framed_netmask\n"; print "$ascend_route_IP\n"; print "$ascend_metric\n"; print "$ascend_idle_limit\n\n"; } close FILE;