#!/usr/bin/perl

#####################################################################
#Author: Kingsly John <kingsly@kingsly.org>
#Date: Mon Dec 24 16:22:25 IST 2001
#
#This script (re)generates the users.conf for licq from the contents
#of the ~/.licq/users directory.
#
#Usage is ./regen.pl > ~/.licq/users.conf
#(Make sure you backup your existing users.conf file)
#
#As usual this script comes with absolutely no guarantees whatsover
#It worked for me for licq 1.1 (CVS) YMMV.
#####################################################################

open U,">$ENV{HOME}/.licq/users.conf";

$n     = 1;
@users = `ls -1 ~/.licq/users`;
print U "[users]\nNumOfUsers = " . scalar(@users) . "\n";

foreach (@users) {

    chomp;
    chop;
    chop;
    chop;
    chop;

    print U "User" . $n++ . " = " . $_ . "\n";

}
