View ¡m../sdba/././././sdba.pl¡n
#!/usr/bin/perl -w ######################################### # # # SDBA Revolution v 2.3 # # # ######################################### package main; require "config.im"; $SDBAVersion = "2.4"; $SDBAStartTime = time; #print $SDBAStartTime; if ($#ARGV >= 0) { die "usage: $0 [IMprotocol] [screenname] [password]\n" if ($#ARGV != 2); $imnet = $ARGV[0]; $screenname = $ARGV[1]; $password = $ARGV[2]; print "\nSetting from console: network=$imnet, sn=$screenname, pw=$password\n"; } if (not defined $JabberServer){$JabberServer = '';} if (not defined $JabberPort){$JabberPort = '';} if (not defined $JabberResource){$JabberResource = '';} if (not defined $admin){$admin = '';} $dmp= ""; $dmp = $screenname.$password.$admin.$imnet.$SDBAStartTime.$SDBAVersion.$ServerName; #Use the module File-Basename so that the script can be called from anywhere. use File::Basename; chdir(dirname($0)); #Seed the random number generator. srand time; #Print two blank lines to the DOS window. print "\n\n"; #Check to make sure the required directories exist. if (-e "commands" ne 1 || -e "bin" ne 1 || -e "impages" ne 1 || -e "logs" ne 1) { print "You seem to be missing the required directories: " . " please make sure everything unzipped correctly."; exit; } #check for integration dir, make it if it isnt there if (-e "integration" ne 1) { mkdir 'integration'; mkdir 'integration/done'; } #Use protocol declared in config.im. require "bin/protocols/$imnet.pl" or die "Looks like you should choose another protocol in config.im"; #Gain usage of all the files in the Handlers, Commands, and Extras folders. @dirs = ("commands","bin"); foreach $dir (@dirs) { opendir(DIR, "./$dir"); foreach $file (sort(grep(!/^\./, readdir(DIR)))) { if (!(-d "$dir/$file")){ #print "Including $file.."; require "$dir/$file"; #print " OK!\n"; } } closedir(DIR); } #Try to connect to the IM server. imconnect($screenname, $password, $ServerName, $JabberServer, $JabberPort, $JabberResource); #Start an infinite sequence of 'do_one_loop's and print the confirmation message. print "\nSDBA Revolution IM Application Server loaded successfully!\n\n"; imcont();