Browse Source

Reset tpl with autoconf

Julien Vaubourg 9 years ago
parent
commit
224b3e6026
1 changed files with 2 additions and 2 deletions
  1. 2 2
      sources/controller.php

+ 2 - 2
sources/controller.php

@@ -205,9 +205,9 @@ dispatch_put('/settings', function() {
     ynh_setting_set('ip6_addr', $ip6_addr);
 
     if($autoconf) {
-      if(!empty($config['openvpn_add'])) {
-        copy('/etc/openvpn/client.conf.tpl.restore', '/etc/openvpn/client.conf.tpl');
+      copy('/etc/openvpn/client.conf.tpl.restore', '/etc/openvpn/client.conf.tpl');
 
+      if(!empty($config['openvpn_add'])) {
         $raw_openvpn = file_get_contents('/etc/openvpn/client.conf.tpl');
         $raw_openvpn .= "\n# Custom\n".$config['openvpn_add'];