Create revoke-cleaner.pl
This commit is contained in:
parent
2a57e89489
commit
22cd72d4a2
1 changed files with 35 additions and 0 deletions
35
revoke-cleaner.pl
Normal file
35
revoke-cleaner.pl
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
# Author @nu11secur1ty
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use diagnostics;
|
||||||
|
use Term::ANSIColor;
|
||||||
|
|
||||||
|
print color('GREEN');
|
||||||
|
print "You should remove all lines which you see on this print with the path";
|
||||||
|
print color('RESET');
|
||||||
|
|
||||||
|
print color('BLUE');
|
||||||
|
print " (/etc/openvpn/easy-rsa/pki/index.txt)\n";
|
||||||
|
print color('RESET');
|
||||||
|
|
||||||
|
print color('GREEN');
|
||||||
|
print "because these users are already";
|
||||||
|
print color('RESET');
|
||||||
|
|
||||||
|
print color('RED');
|
||||||
|
print " revoked!\n\n\n";
|
||||||
|
print color('RESET');
|
||||||
|
|
||||||
|
my $ENV = `cat /etc/openvpn/easy-rsa/pki/index.txt | grep R`;
|
||||||
|
print "$ENV";
|
||||||
|
|
||||||
|
## Cleaning
|
||||||
|
my $ENVPKI = "/etc/openvpn/easy-rsa/pki/index.txt";
|
||||||
|
print "Preparing for cleaning...\n";
|
||||||
|
print "Please, choose the username...\n";
|
||||||
|
|
||||||
|
chomp (my $username = <STDIN>);
|
||||||
|
my $cleaner = `sed -i '/$username/d' $ENVPKI`;
|
||||||
|
|
||||||
|
exit 0;
|
Loading…
Reference in a new issue