Changeset 3186 for trunk/engine/setup/ispcp-setup-methods.pl
- Timestamp:
- 08/11/10 11:24:56 (22 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
engine/setup/ispcp-setup-methods.pl (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/omega-1.0.4/language-files (added) merged: 2611-2639,2641-2645 /branches/omega-1.0.5/language-files (added) merged: 2656
- Property svn:mergeinfo changed
-
trunk/engine/setup/ispcp-setup-methods.pl
r3166 r3186 690 690 691 691 sub ask_fastcgi { 692 693 692 push_el(\@main::el, 'ask_fastcgi()', 'Starting...'); 694 693 695 694 my $rdata = undef; 696 697 695 my $qmsg = "\n\tFastCGI Version: [f]cgid or fast[c]gi. [fcgid]: "; 698 696 699 697 print STDOUT $qmsg; 700 701 698 chomp($rdata = readline \*STDIN); 702 699 703 700 if (!defined($rdata) || $rdata eq '') { 704 705 701 $main::ua{'php_fastcgi'} = 'fcgid'; 706 707 702 } else { 708 709 703 if ($rdata eq 'fcgid' || $rdata eq 'f') { 710 711 704 $main::ua{'php_fastcgi'} = 'fcgid'; 712 713 705 } elsif ($rdata eq 'fastcgi' || $rdata eq 'c') { 714 715 706 $main::ua{'php_fastcgi'} = 'fastcgi'; 716 717 707 } else { 718 719 708 print STDOUT colored(['bold red'], "\n\tERROR:") . 720 709 " Only '[f]cgid' or 'fast[c]gi' are allowed!"; 721 722 710 return 1; 723 711 } … … 729 717 } 730 718 719 sub ask_timezone { 720 push_el(\@main::el, 'ask_timezone()', 'Starting...'); 721 722 my $rdata; 723 my $qmsg = "\n\tServer's Timezone [Europe/London]: "; 724 725 print STDOUT $qmsg; 726 chomp($rdata = readline \*STDIN); 727 728 if (!defined($rdata) || $rdata eq '') { 729 $main::ua{'php_timezone'} = 'Europe/London'; 730 } else { 731 if ($rdata =~ m/^UTC|([Africa|America|Antarctica|Arctic|Asia|Atlantic|Australia|Europe|Indian|Pacific]\/[A-Z][a-z]+)$/i) { 732 $main::ua{'php_timezone'} = $rdata; 733 } else { 734 print STDOUT colored(['bold red'], "\n\tERROR:") . 735 $rdata . " is not a valid Timezone! " . 736 "The city must start with a capital letter, e.g. Europe/London"; 737 return 1; 738 } 739 } 740 741 push_el(\@main::el, 'ask_timezone()', 'Ending...'); 742 743 0; 744 } 745 731 746 sub ask_awstats_on { 732 733 747 push_el(\@main::el, 'ask_awstats_on()', 'Starting...'); 734 748 … … 737 751 738 752 print STDOUT $qmsg; 739 740 753 chomp($rdata = readline \*STDIN); 741 754 742 755 if (!defined($rdata) || $rdata eq '') { 743 744 756 $main::ua{'awstats_on'} = 'no'; 745 746 757 } else { 747 748 758 if ($rdata eq 'yes' || $rdata eq 'y') { 749 750 759 $main::ua{'awstats_on'} = 'yes'; 751 752 760 } elsif ($rdata eq 'no' || $rdata eq 'n') { 753 754 761 $main::ua{'awstats_on'} = 'no'; 755 756 762 } else { 757 758 763 print STDOUT colored(['bold red'], "\n\tERROR:") . 759 764 " Only '(y)es' and '(n)o' are allowed!"; … … 768 773 769 774 sub ask_awstats_dyn { 770 771 775 push_el(\@main::el, 'ask_awstats_dyn()', 'Starting...'); 772 776 … … 775 779 776 780 print STDOUT $qmsg; 777 778 781 chomp($rdata = readline \*STDIN); 779 782 780 783 if (!defined($rdata) || $rdata eq '') { 781 782 784 $main::ua{'awstats_dyn'} = '0'; 783 784 785 } else { 785 786 786 if ($rdata eq 'dynamic' || $rdata eq 'd') { 787 788 787 $main::ua{'awstats_dyn'} = '0'; 789 790 788 } elsif ($rdata eq 'static' || $rdata eq 's') { 791 792 789 $main::ua{'awstats_dyn'} = '1'; 793 794 790 } else { 795 796 791 print STDOUT colored(['bold red'], "\n\tERROR:") . 797 792 " Only '[d]ynamic' or '[s]tatic' are allowed!"; 798 799 793 return 1; 800 794 } … … 817 811 # Built, store and install the ispCP crontab file 818 812 sub setup_crontab { 819 820 813 push_el(\@main::el, 'setup_crontab()', 'Starting...'); 821 814 822 my ($rs, $rdata, $cmd) = (undef, undef, undef); 823 824 my $cfg_tpl = undef; 815 my ($rs, $rdata, $cmd, $cfg_tpl); 825 816 my $cfg = \$cfg_tpl; 826 817 … … 835 826 # Determines the path of production directory 836 827 if ($main::cfg{'ROOT_GROUP'} eq 'wheel') { 837 838 828 $prod_dir = '/usr/local/etc/ispcp/cron.d'; 839 840 829 } else { 841 842 830 $prod_dir = '/etc/cron.d' 843 831 } … … 1416 1404 1417 1405 if(-e '/usr/sbin/a2ensite') { 1418 1419 1406 sys_command("/usr/sbin/a2ensite 01_awstats.conf $main::rlogfile"); 1420 1407 } … … 1424 1411 # Update Apache logrotate file - Begin 1425 1412 1426 # FIXME: check for openSUSE and other dists... 1427 # Todo create dedicated directory for backup logrotate configuration file 1413 # if the distribution provides an apache or apache2 logrotation file, 1414 # update it with the awstats information. If not, use the ispcp file. 1415 # logrotation should be never executed twice. Therefore it is sane to 1416 # define it two times in different scopes. 1428 1417 foreach(qw/apache apache2/) { 1429 1418 … … 2312 2301 '{OTHER_ROOTKIT_LOG}' => ($main::cfg{'OTHER_ROOTKIT_LOG'} ne '') 2313 2302 ? ":$main::cfg{'OTHER_ROOTKIT_LOG'}" : '', 2314 '{PHP_STARTER_DIR}' => $main::cfg{'PHP_STARTER_DIR'} 2303 '{PHP_STARTER_DIR}' => $main::cfg{'PHP_STARTER_DIR'}, 2304 '{PHP_TIMEZONE}' => $main::cfg{'PHP_TIMEZONE'} 2315 2305 ); 2316 2306
Note: See TracChangeset
for help on using the changeset viewer.
