• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Add a block of IPs

CruzMark

Regular Pleskian
Here's a simple (and insecure) perl script that will add a block of IPs to plesk from the command line. I accept no responsibility for its use or mis-use. Since it uses the plesk ipmanage tool, it is unlikely that you'll cause your system to implode.

#!/usr/bin/perl

# This script causes heavy load on the server and takes several minutes
# to run.

# The script assumes that the block is Class C or less.
# IP_SUBNET should be the first three octets of the IP.
# MASK should be in octet form (ex. 255.255.255.0)
#
# See (DIRECTORY)/psa/bin/ipmanage --help for more info

if (@ARGV != 5) {
print "Usage: create_ip_block.pl IP_SUBNET MASK INTERFACE TYPE CERT\n";
exit;
}

# Turn debug 'on' to test script before actually adding IPs!
# $debug = 'on';

# Change count based on the IPs you are trying to add. Settings below
# are for a class C subnet

my $start_count = 1;
my $end_count = 254;

# replace with path to your psa/bin directory. Below is for FreeBSD
my $psa_bin_path = "/usr/local/psa/bin";

my $ip_subnet = $ARGV[0];
my $mask = $ARGV[1];
my $interface = $ARGV[2];
my $type = $ARGV[3];
my $ssl = $ARGV[4];

for ($count="$start_count"; $count <= $end_count; $count++) {
$ip = "$ip_subnet" . "." . "$count";
if ($debug eq 'on') {
print "$psa_bin_path/ipmanage -c $ip -mask $mask -interface $interface -type $type -ssl_certificate $ssl\n";
} else {
`$psa_bin_path/ipmanage -c $ip -mask $mask -interface $interface -type $type -ssl_certificate $ssl`;
}
}
 
Back
Top