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

10 lines
368 B
Plaintext

{
my $openvpn = $DB->get('openvpn-routed') || $DB->new_record('openvpn-routed', {type => 'service'});
my $management = $openvpn->prop('ManagementPassword') || '';
return "" if ($management ne '');
# Generate a random password
$pass=`/usr/bin/openssl rand -base64 20 | tr -c -d '[:alnum:]'`;
$openvpn->set_prop('ManagementPassword',"$pass");
}