smeserver-openvpn-bridge/root/etc/e-smith/db/configuration/migrate/50openvpn-bridge-management-pass

13 lines
452 B
Plaintext

{
my $openvpn = $DB->get('openvpn-bridge') || $DB->new_record('openvpn-bridge', {type => 'service'});
my $management = $openvpn->prop('management') || '';
# If the management interface is already defined, return nothing
return "" if ($management ne '');
# Else, we generate a random password
$pass=`/usr/bin/openssl rand -base64 20 | tr -c -d '[:alnum:]'`;
$openvpn->set_prop('management',"localhost:11194:$pass");
}