Blame
Date:
Fri Dec 17 13:35:57 2021 UTC
Message:
Imported sources
01
2021-12-17
jrmu
#!/usr/bin/perl
02
2021-12-17
jrmu
03
2021-12-17
jrmu
package VPN;
04
2021-12-17
jrmu
05
2021-12-17
jrmu
use strict;
06
2021-12-17
jrmu
use warnings;
07
2021-12-17
jrmu
use OpenBSD::Pledge;
08
2021-12-17
jrmu
use OpenBSD::Unveil;
09
2021-12-17
jrmu
10
2021-12-17
jrmu
sub init {
11
2021-12-17
jrmu
}
12
2021-12-17
jrmu
# if ($reply =~ /^!vpn (.*) ([-_0-9a-zA-Z]+)$/i) {
13
2021-12-17
jrmu
# my $ircnick = $1;
14
2021-12-17
jrmu
# my $newnick = $2;
15
2021-12-17
jrmu
# if ($staff !~ /$sender/) {
16
2021-12-17
jrmu
# return;
17
2021-12-17
jrmu
# }
18
2021-12-17
jrmu
# my $password = newpass();
19
2021-12-17
jrmu
# createvpn($password, $newnick);
20
2021-12-17
jrmu
# sendmsg($bot, $sender, "vpn created for $newnick");
21
2021-12-17
jrmu
#my $msg = <<"EOF";
22
2021-12-17
jrmu
#Your vpn account has been created! Username: $newnick with password: $password
23
2021-12-17
jrmu
#Our official support channel is #vpn. To connect, please follow these instructions: https://ircnow.org/kb/doku.php?id=vpn:vpn .
24
2021-12-17
jrmu
#EOF
25
2021-12-17
jrmu
# sendmsg($bot, $ircnick, $msg);
26
2021-12-17
jrmu
# }
27
2021-12-17
jrmu
#sub createvpn {
28
2021-12-17
jrmu
# my ($password, $username) = @_;
29
2021-12-17
jrmu
# `doas sh -c 'echo "user '$username' '$password'" >> /etc/iked.conf'`;
30
2021-12-17
jrmu
# `doas rcctl reload iked`;
31
2021-12-17
jrmu
#}
32
2021-12-17
jrmu
33
2021-12-17
jrmu
1; # MUST BE LAST STATEMENT IN FILE
IRCNow