加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

一个简单的auth perl程序

发布时间:2020-12-15 23:45:14 所属栏目:大数据 来源:网络整理
导读:my @in_ip_yd=qw(....); my @out_ip_yd=(....); sub sync_auth_yd { ? ? my ($in_ip,$out_ip) = @_;? ? ? my @in_ip = @$in_ip; ? ? my @out_ip = @$out_ip; ? ? foreach $var (@out_ip) ? ? { ?? ? ? ? ? my(undef,undef,$tmp,$out_suffix)= split /./,$va

my @in_ip_yd=qw(....);
my @out_ip_yd=(....);

sub sync_auth_yd

{
? ? my ($in_ip,$out_ip) = @_;?
? ? my @in_ip = @$in_ip;
? ? my @out_ip = @$out_ip;
? ? foreach $var (@out_ip)
? ? { ??
? ? ? ? my(undef,undef,$tmp,$out_suffix)= split /./,$var;
? ? ? ? foreach $j (@in_ip)
? ? ? ? { ??
? ? ? ? ? ? my(undef,$in_suffix)= split /./,$j;
? ? ? ? ? ? if($in_suffix == $out_suffix)
? ? ? ? ? ? { ??
? ? ? ? ? ? ? ? if(! -e $in_suffix)
? ? ? ? ? ? ? ? { ??
? ? ? ? ? ? ? ? ? ? mkdir $in_suffix or die "cannot make $in_suffix directory:$!n";
? ? ? ? ? ? ? ? } ??
? ? ? ? ? ? ? ? open $template,"<","auth_config.cnf.template";
? ? ? ? ? ? ? ? open $cnf,">","$in_suffix/auth_config.cnf";
? ? ? ? ? ? ? ? while(<$template>)
? ? ? ? ? ? ? ? { ??
? ? ? ? ? ? ? ? ? ? s/$outip/$var/;
? ? ? ? ? ? ? ? ? ? s/$inip/$j/;
? ? ? ? ? ? ? ? ? ? s/$cliinip/$j/;
? ? ? ? ? ? ? ? ? ? s/$mport/10400/;
? ? ? ? ? ? ? ? ? ? s/$idc/1/;
? ? ? ? ? ? ? ? ? ? s/$port/4828/;
? ? ? ? ? ? ? ? ? ? if($in_suffix == 97)?
? ? ? ? ? ? ? ? ? ? { ??
? ? ? ? ? ? ? ? ? ? ? ? s/max_connection = 30000/max_connection = 20000/;
? ? ? ? ? ? ? ? ? ? ? ? s/max_wait_list = 22000/max_wait_list = 19000/;

? ? ? ? ? ? ? ? ? ? } ??

? ? ? ? ? ? ? ?print $cnf $_;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? close $template;
? ? ? ? ? ? ? ? close $cnf;
? ? ? ? ? ? ? ? #$tmp=`rsync -z $in_suffix/auth_config.cnf $j::gwconf/redis.rc --port=7874`;
? ? ? ? ? ? ? ? unlink "$in_suffix/auth_config.cnf";
? ? ? ? ? ? ? ? rmdir $in_suffix
? ? ? ? ? ? }
? ? ? ? }
? ? }
}

sync_auth_yd(@in_ip_yd,@out_ip_yd);

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读