Date: Fri, 19 Jan 2001 15:21:13 -0500 From: "Matthew Emmerton" <matt@gsicomp.on.ca> To: "Joe Oliveiro" <joe@advancewebhosting.com>, <freebsd-questions@FreeBSD.ORG> Subject: Re: Rebuilding a flatfile db forn a hash file Message-ID: <005501c08255$5ef9bcb0$1200a8c0@gsicomp.on.ca> References: <Pine.BSF.4.21.0101191443220.11819-100000@joe.pythonvideo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> The owner of one of the boxes i admin is a complete idiot and zero'd out > his /etc/virtusertable file. The only thing he has on the server now is a > hashed file of the /etc/virtusertable file (virtusertable.db). > > Is there a way to recreate the virtusertable text file from the hashed > file? This Perl program should do what you want: #!/usr/bin/perl dbmopen %VIRTUSERTABLE, "/etc/mail/virtusertable", 0666 or die "Can't open virtusertable: $!\n"; while (($key, $val) = each %VIRTUSERTABLE) { print $key, "\t", $val, "\n"; } dmbclose %VIRTUSERTABLE; If anyone is wondering, this is an example take directly from "Programmg Perl, 2/ed", p154. -- Matt Emmerton To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?005501c08255$5ef9bcb0$1200a8c0>