Ok, un script perl qui change les ports au démarrage en en prnant un au hasard dans un pool (tous ces ports doivent etre ouverts dans le firewall):
#!/usr/bin/perl
use strict;
use Config::IniFiles;
#--------------------------------------------------------
# Parameters: Edit them to fit to your box
#--------------------------------------------------------
my $eMuleConfigPath = "/home/login/.eMule";
my $aMulePath = "amule &";
my @TCPPool = (1234,4565,7892,87541,8282);
my @UDPPool = (1254,4585,7891,87741,8382);
#--------------------------------------------------------
# Do not edit below unless you know what you are doing
#--------------------------------------------------------
# Reading old configuration
my $cfg = new Config::IniFiles -file => $eMuleConfigPath;
my $portTCP = $cfg->val('eMule', 'Port');
my $portUDP = $cfg->val('eMule', 'UDPPort');
print "Current TCP Port: $portTCP, Current UDP Port: $portUDP\n";
# Generating new ports
srand; # not needed for 5.004 and later
# New TCP Port
my $index = rand @TCPPool;
my $newTCPPort = $TCPPool[$index];
# New UDP Port
$index = rand @UDPPool;
my $newUDPPort = $UDPPool[$index];
print "New TCP Port: $newTCPPort, New UDP Port: $newUDPPort\n";
# Setting new ports
$cfg->setval ('eMule', 'Port', $newTCPPort);
$cfg->setval ('eMule', 'UDPPort', $newUDPPort);
# Writing file
$cfg->RewriteConfig();
# Lauching aMule
exec ($aMulePath);
- Installer le package perl Config::IniFiles
- copier dans pamule.pl && chmod 755 pamule.pl
- Editer #Parameters
- et hop, ./pamule.pl pour lancer amule
Thepolish