#!/usr/bin/perl package VPN; use strict; use warnings; use OpenBSD::Pledge; use OpenBSD::Unveil; sub init { } # if ($reply =~ /^!vpn (.*) ([-_0-9a-zA-Z]+)$/i) { # my $ircnick = $1; # my $newnick = $2; # if ($staff !~ /$sender/) { # return; # } # my $password = newpass(); # createvpn($password, $newnick); # sendmsg($bot, $sender, "vpn created for $newnick"); #my $msg = <<"EOF"; #Your vpn account has been created! Username: $newnick with password: $password #Our official support channel is #vpn. To connect, please follow these instructions: https://ircnow.org/kb/doku.php?id=vpn:vpn . #EOF # sendmsg($bot, $ircnick, $msg); # } #sub createvpn { # my ($password, $username) = @_; # `doas sh -c 'echo "user '$username' '$password'" >> /etc/iked.conf'`; # `doas rcctl reload iked`; #} 1; # MUST BE LAST STATEMENT IN FILE