#!/usr/bin/perl die " \# Silly little Perl script to allow/disallow X traffic from AVIDD compute nodes (and head node) \# USAGE: \# \$ perl modify-xhost-for-avidd-x-traffic.pl [b/i] [add/remove] \# ** Either 'b' or 'i' must be specified for Bloomington/Indy cluster; \# ** Either add or remote must be specified to add/remove IPs from xhost \# allow list \# Comments? Email Arvind Gopu! \n" if (($#ARGV < 1) || (($ARGV[0] ne 'b') && ($ARGV[0] ne 'i')) || (($ARGV[1] ne 'add') && ($ARGV[1] ne 'remove'))); my $indy_or_bloomington = 228; my $sign = "+"; $indy_or_bloomington = 229 if ($ARGV[0] eq "i"); $sign = "-" if ($ARGV[1] eq "remove"); for (my $i = 1; $i <= 96; $i++) { $host_list .= $sign."149.165.$indy_or_bloomington.$i "; } # compute nodes for (my $i = 231; $i <= 233; $i++) { $host_list .= $sign."149.165.$indy_or_bloomington.$i "; } # head nodes system ("xhost $host_list"); exit (0);