[BACK]Return to VPN.pm CVS log [TXT][DIR] Up to [local] / botnow

Annotation of botnow/VPN.pm, Revision 1.1

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

CVSweb