Date: Thu, 30 Sep 1999 15:35:55 -0400 From: "Jason J. Horton" <jason@intercom.com> To: freebsd-isp@freebsd.org Cc: up@3.am Subject: solaris2freebsd.pl FIXED (was Re: changing server platforms ) Message-ID: <37F3BB9B.457FD002@intercom.com> References: <Pine.GSO.4.10.9909301337050.26738-100000@richard2.pil.net>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------E3D35EB3F838B62FAC17DF5E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sorry folks, I had accidently released an broken version of the script, so here is a new revision. I added some features, read the source for directions and revision history. -- -Jason J. Horton <jason@intercom.com> Moving Target Intercom Online Inc. 212.376.7440 ext 21 | http://www.intercom.com --------------E3D35EB3F838B62FAC17DF5E Content-Type: application/x-perl; name="solaris2freebsd.pl" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="solaris2freebsd.pl" #!/usr/bin/perl ################################################################################ # # # solaris2freebsd.pl version 0.0.2 30/09/1999 # # written by Jason J. Horton and Sergey Mikhol # # for Intercom Online Inc. # # # # <INSERT STANDARD BSD STYLE LICENSE HERE> # # # ################################################################################ ################################################################################ # # # Revision History: # # # # ver 0.0.1 - Initial version. # # ver 0.0.2 - fixed while loop problem, added prompting for file # # locations, mild error checking and fix for out of # # sync passwd and shadow files. # # # ################################################################################ ################################################################################ # # # Instructions: # # run the script from the command line, and you will be prompted # # for the location of your shadow and password files, as well as # # where you want the FreeBSD compatable master.password file to # # go. Be careful not to overwrite files etc. # # # ################################################################################ print "location of Solaris passwd file: "; chomp($passwd = <STDIN>); print "location of Solaris shadow file: "; chomp($shadow = <STDIN>); print "where shall I put the\nFreeBSD master.passwd file? "; chomp($outputfile = <STDIN>); open(SHAD, "$shadow")||die "Can't open the shadow file!\n"; while(<SHAD>) { chop; ($as, $bs, $cs, $ds, $es, $fs, $gs, $hs, $is) = split(/:/); open(PASS, "$passwd") || die "Can't open the passwd file!\n"; while(<PASS>) { chop; ($ap, $bp, $cp, $dp, $ep, $fp, $gp) = split(/:/); if ($as eq $ap) { open(OUTPUT, ">>$outputfile") || die "Can't open the master.passwd file!\n"; print OUTPUT "$as\:$bs\:$cp\:$dp\:\:0\:0\:$ep\:$fp\:$gp\n"; close(PASS); } } } close(SHAD); --------------E3D35EB3F838B62FAC17DF5E-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?37F3BB9B.457FD002>