Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- $mysql_pass = `cat /root/.lp_config/mysql_pass`;
- chomp $mysql_pass;
- $domain = `cat ~/.lp_config/domain`;
- chomp $domain;
- `mysql -u root --password=$mysql_pass -e "select home_directory from accounts_data.accounts into outfile 'dirs.txt';"`;
- open f, "/var/lib/mysql/dirs.txt" or die $!;
- open sec, ">> /etc/httpd/conf.d/user-security.conf" or die $!;
- while(<f>) {
- chomp $_;
- $sub = $_;
- $sub =~ s/\/htdocs\///;
- if(-e "$sub/.done") {
- next;
- }
- print sec "<Directory $_>\n";
- print sec "php_admin_value open_basedir \"$sub/htdocs\"\n";
- print sec "php_admin_value upload_tmp_dir \"$sub/htdocs\"\n";
- if(-e "$sub/.phpsec") {
- print sec "php_admin_flag safe_mode off\n";
- `mysql -u root --password=$mysql_pass -e "select user_name from accounts_data.accounts where home_directory='$_' into outfile 'user.txt';"`;
- $user = `cat /var/lib/mysql/user.txt`;
- chomp $user;
- print "$user\n";
- print sec "php_admin_value mail.force_extra_parameters \"-f $user\@$domain\"\n";
- `rm -f /var/lib/mysql/user.txt`;
- }
- print sec "</Directory>\n";
- `touch $sub/.done`;
- }
- close f;
- close sec;
- `rm -f /var/lib/mysql/dirs.txt`;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement