Add time syncing before launching openvpn, to avoid issues due to 'certificate not yet valid'

This commit is contained in:
Julien Vaubourg 2017-09-06 01:54:35 +02:00
parent 33aafd1196
commit 355b24ea0c

View File

@ -129,6 +129,8 @@ start_openvpn() {
[ "${ynh_server_proto}" == tcp ] && proto=tcp-client
fi
sync_time
cp /etc/openvpn/client.conf{.tpl,}
sed "s|<TPL:SERVER_NAME>|${ynh_server_name}|g" -i /etc/openvpn/client.conf
@ -195,6 +197,12 @@ stop_openvpn() {
## Tools
sync_time() {
systemctl stop ntp
ntpd -qg &> /dev/null
systemctl start ntp
}
ynh_setting_get() {
app=${1}
setting=${2}