From owner-freebsd-isp Thu Sep 30 12:34:28 1999 Delivered-To: freebsd-isp@freebsd.org Received: from c004.sfo.cp.net (c004-h019.c004.sfo.cp.net [209.228.14.106]) by hub.freebsd.org (Postfix) with SMTP id 684C614CB1 for ; Thu, 30 Sep 1999 12:34:24 -0700 (PDT) (envelope-from jason@intercom.com) Received: (cpmta 28325 invoked from network); 30 Sep 1999 12:34:22 -0700 Received: from shagalicious.com (HELO intercom.com) (206.98.165.250) by smtp.intercom.com with SMTP; 30 Sep 1999 12:34:22 -0700 X-Sent: 30 Sep 1999 19:34:22 GMT Message-ID: <37F3BB9B.457FD002@intercom.com> Date: Thu, 30 Sep 1999 15:35:55 -0400 From: "Jason J. Horton" Organization: Intercom Online Inc. X-Mailer: Mozilla 4.7 [en] (X11; I; FreeBSD 3.3-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-isp@freebsd.org Cc: up@3.am Subject: solaris2freebsd.pl FIXED (was Re: changing server platforms ) References: Content-Type: multipart/mixed; boundary="------------E3D35EB3F838B62FAC17DF5E" Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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 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. # # # # # # # ################################################################################ ################################################################################ # # # 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 = ); print "location of Solaris shadow file: "; chomp($shadow = ); print "where shall I put the\nFreeBSD master.passwd file? "; chomp($outputfile = ); open(SHAD, "$shadow")||die "Can't open the shadow file!\n"; while() { chop; ($as, $bs, $cs, $ds, $es, $fs, $gs, $hs, $is) = split(/:/); open(PASS, "$passwd") || die "Can't open the passwd file!\n"; while() { 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