Reset tpl with autoconf

This commit is contained in:
Julien Vaubourg 2015-09-29 02:57:16 +02:00
parent 1139246888
commit 224b3e6026

View File

@ -205,9 +205,9 @@ dispatch_put('/settings', function() {
ynh_setting_set('ip6_addr', $ip6_addr); ynh_setting_set('ip6_addr', $ip6_addr);
if($autoconf) { 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 = file_get_contents('/etc/openvpn/client.conf.tpl');
$raw_openvpn .= "\n# Custom\n".$config['openvpn_add']; $raw_openvpn .= "\n# Custom\n".$config['openvpn_add'];