root/branches/licq/website/licq.gnomeicuconvert

Revision 4129, 2.2 kB (checked in by anonymous, 4 years ago)

This commit was manufactured by cvs2svn to create branch 'licq'.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1#!/usr/bin/perl
2
3# Created by:
4#   Stijn Van Looy <Stijn.VanLooy@rug.ac.be>
5#
6# Comments: Use at own risk, first doublecheck the files generated by this
7#   script, before you overwrite your licq configfiles. I guess you
8#   ain't a fool. ;-)
9#
10# Tested with gnomeICU 0.93 and licq 0.81.
11
12# HOW TO USE THIS SCRIPT:
13#
14# First you need to copy the gnomeICU config file (mostly found in
15# ~/.gnome, depending on version, it can be named GnomeICU, gnomeicu,
16# .GnomeICU, and so on) into the directory you put this script in,
17# and rename it to GnomeICU.
18#
19# Then edit it so only the lines containing uin=alias remain in the file.
20# (The last line also needs a linefeed, otherwise the last char of the
21# last alias is stripped off)
22#
23# Run this script.
24#
25# Copy users.conf and the users dir into ~/.licq/
26
27$infile = 'GnomeICU';
28@uins = ();
29@aliases = ();
30
31open (infile, $infile);
32while ($line = <infile>) {
33    chop $line;
34    $temp = $line;
35    $temp =~ s/([0-9]+)=(.*)/\1/;
36    push @uins, $temp;
37    $line =~ s/([0-9]+)=(.*)/\2/;
38    push @aliases, $line;
39}
40close infile;
41$temp = $#uins + 1;
42print "Converting $temp UINs ... \n";
43
44$head = "
45[user]
46History = default
47Groups.System = 0
48Groups.User = 1
49Ip =
50Port =
51NewUser = 0
52NewMessages = 0
53LastOnline = 0
54AutoAccept = 0
55StatusToUser = 65535
56CustomAutoRsp = \n";
57$tail = "FirstName =
58LastName =
59Email1 =
60Email2 =
61City =
62State =
63PhoneNumber =
64FaxNumber =
65Address =
66CellularNumber =
67Zipcode = 0
68Country = 65535
69Timezone = 0
70Authorization = 1
71HideEmail = 0
72Age = 65535
73Gender = 0
74Homepage =
75BirthYear = 0
76BirthMonth = 0
77BirthDay = 0
78Language1 = 0
79Language2 = 0
80Language3 = 0
81CompanyCity =
82CompanyState =
83CompanyPhoneNumber =
84CompanyFaxNumber =
85CompanyAddress =
86CompanyName =
87CompanyDepartment =
88CompanyPosition =
89CompanyHomepage = \n";
90
91system 'mkdir users; chmod 700 users';
92for (0..$#uins) {
93    $outfile = ">users/$uins[$_].uin";
94    open (outfile, $outfile);
95    print outfile $head;
96    print outfile "Alias = $aliases[$_]\n";
97    print outfile $tail;
98    close outfile;
99}
100
101$outfile = '>users.conf';
102open (outfile, $outfile);
103$temp = $#uins + 1;
104print outfile "[users]\nNumOfUsers = $temp\n";
105for (0..$#uins) {
106    $temp = $_ + 1;
107    print outfile "User$temp = $uins[$_]\n";
108}
109close outfile;
110print "Done.
111Now copy the users dir and the users.conf file into your licq dir (~/.licq).\n"
Note: See TracBrowser for help on using the browser.