#!/usr/bin/perl -T use strict; # No dependencies: # use CGI::Carp qw(fatalsToBrowser); $ENV{PATH} = "/bin:/usr/bin"; delete @ENV{ 'IFS', 'CDPATH', 'ENV', 'BASH_ENV' }; #----------------------------------------------------------------------------# # For information on what this script is used for, please see: # http://dadamailproject.com/d/install_dada_mail.pod.html # What's the name of the file I'm looking for to uncompress? # Basic Dada Mail my $basic = 'dada-7_0_0-alpha1.tar.gz'; # # # Pro Dada my $pro = 'pro_' . $basic; my $using = $pro; print "Content-type:text/html\r\n\r\n"; print '

Adventures with Dada Mail!

'; if ( -e 'dada' ) { print "

Yikes! A directory named, \"dada\" already exists in this location! Please manually move this directory, before running this script!

"; exit; } if ( !-e $pro ) { print "

Can't find Pro Dada distribution at, $pro, looking for Basic distribution...

"; $using = $basic; if ( !-e $basic ) { print '

Yikes! Can\'t find either the ' . $basic . ' or ' . $pro . ' Dada Mail distributions to uncompress!

'; exit; } else { print "

Found, $basic!

"; } } print "

Starting Adventure...

"; print "

Uncompressing $using...

"; `tar -xvzf $using`; if ( !-e 'dada' ) { `gunzip $using`; my $tar = $using; $tar =~ s/\.gz$//; if ( !-e $tar ) { print '

Can\'t find ' . $tar . ' to uncompress!

'; print '

You may have to uncompress and prep Dada Mail manually.

'; exit; } else { print "

Success!

"; print "

Unrolling $tar

"; `tar -xvf $tar`; } } else { print "

Success!

"; } print "

Checking to see if \"dada\" directory now exists...

"; if ( !-e 'dada' ) { print "

Can't find 'dada' directory!

"; exit; } else { print "

Success!

"; } print "

Changing permissions of dada/mail.cgi to, 755

"; `chmod 755 dada`; `chmod 755 dada/DADA`; `chmod 755 dada/mail.cgi`; `chmod 777 dada/DADA/Config.pm`; my $installer_loc = 'dada/installer-disabled'; my $new_installer_loc = 'dada/installer'; print "

Enabling installer at $installer_loc by moving it to, $new_installer_loc

"; `mv $installer_loc $new_installer_loc`; `chmod 755 $new_installer_loc`; `chmod 755 $new_installer_loc/install.cgi`; print "

Done!

"; print "

Install and Configure Dada Mail!

";