Skip to content

Commit eb59466

Browse files
author
Till Brehm
committed
Force changing of LE symlinks when LE is disabled and enabled again.
1 parent 5d05ccb commit eb59466

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,8 @@ function update($event_name, $data) {
12701270
if ($web_config["website_symlinks_rel"] == 'y') {
12711271
$this->create_relative_link(escapeshellcmd($key_tmp_file), escapeshellcmd($key_file));
12721272
} else {
1273-
exec("ln -s ".escapeshellcmd($key_tmp_file)." ".escapeshellcmd($key_file));
1273+
if(@is_link($key_file)) $app->system->unlink($key_file);
1274+
if(@file_exists($key_tmp_file)) exec("ln -s ".escapeshellcmd($key_tmp_file)." ".escapeshellcmd($key_file));
12741275
}
12751276

12761277
if(is_file($crt_file)) {
@@ -1282,7 +1283,8 @@ function update($event_name, $data) {
12821283
if($web_config["website_symlinks_rel"] == 'y') {
12831284
$this->create_relative_link(escapeshellcmd($crt_tmp_file), escapeshellcmd($crt_file));
12841285
} else {
1285-
exec("ln -s ".escapeshellcmd($crt_tmp_file)." ".escapeshellcmd($crt_file));
1286+
if(@is_link($crt_file)) $app->system->unlink($crt_file);
1287+
if(@file_exists($crt_tmp_file))exec("ln -s ".escapeshellcmd($crt_tmp_file)." ".escapeshellcmd($crt_file));
12861288
}
12871289

12881290
if(is_file($bundle_file)) {
@@ -1294,7 +1296,8 @@ function update($event_name, $data) {
12941296
if($web_config["website_symlinks_rel"] == 'y') {
12951297
$this->create_relative_link(escapeshellcmd($bundle_tmp_file), escapeshellcmd($bundle_file));
12961298
} else {
1297-
exec("ln -s ".escapeshellcmd($bundle_tmp_file)." ".escapeshellcmd($bundle_file));
1299+
if(@is_link($bundle_file)) $app->system->unlink($bundle_file);
1300+
if(@file_exists($bundle_tmp_file)) exec("ln -s ".escapeshellcmd($bundle_tmp_file)." ".escapeshellcmd($bundle_file));
12981301
}
12991302

13001303
/* we don't need to store it.

server/plugins-available/nginx_plugin.inc.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,8 @@ function update($event_name, $data) {
13441344
if ($web_config["website_symlinks_rel"] == 'y') {
13451345
$this->create_relative_link(escapeshellcmd($key_tmp_file), escapeshellcmd($key_file));
13461346
} else {
1347-
exec("ln -s ".escapeshellcmd($key_tmp_file)." ".escapeshellcmd($key_file));
1347+
if(@is_link($key_file)) $app->system->unlink($key_file);
1348+
if(@file_exists($key_tmp_file)) exec("ln -s ".escapeshellcmd($key_tmp_file)." ".escapeshellcmd($key_file));
13481349
}
13491350

13501351
if(is_file($crt_file)) {
@@ -1356,7 +1357,8 @@ function update($event_name, $data) {
13561357
if($web_config["website_symlinks_rel"] == 'y') {
13571358
$this->create_relative_link(escapeshellcmd($crt_tmp_file), escapeshellcmd($crt_file));
13581359
} else {
1359-
exec("ln -s ".escapeshellcmd($crt_tmp_file)." ".escapeshellcmd($crt_file));
1360+
if(@is_link($crt_file)) $app->system->unlink($crt_file);
1361+
if(@file_exists($crt_tmp_file))exec("ln -s ".escapeshellcmd($crt_tmp_file)." ".escapeshellcmd($crt_file));
13601362
}
13611363

13621364
/* we don't need to store it.

0 commit comments

Comments
 (0)