Skip to content

Commit ef4dff9

Browse files
author
Marius Burkard
committed
Merge branch '6221-installer-doesn-t-account-for-dangling-symlinks-of-letsencrypt-hook-files' into 'develop'
Resolve "installer doesn't account for dangling symlinks of letsencrypt hook files" Closes #6221 See merge request ispconfig/ispconfig3!1516
2 parents 7120344 + caede4c commit ef4dff9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

install/lib/installer_base.lib.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2923,16 +2923,25 @@ public function make_ispconfig_ssl_cert() {
29232923
// This script is needed earlier to check and open http port 80 or standalone might fail
29242924
// Make executable and temporary symlink latest letsencrypt pre, post and renew hook script before install
29252925
if(file_exists(ISPC_INSTALL_ROOT . '/server/scripts/letsencrypt_pre_hook.sh') && !file_exists('/usr/local/bin/letsencrypt_pre_hook.sh')) {
2926+
if(is_link('/usr/local/bin/letsencrypt_pre_hook.sh')) {
2927+
unlink('/usr/local/bin/letsencrypt_pre_hook.sh');
2928+
}
29262929
symlink(ISPC_INSTALL_ROOT . '/server/scripts/letsencrypt_pre_hook.sh', '/usr/local/bin/letsencrypt_pre_hook.sh');
29272930
chown('/usr/local/bin/letsencrypt_pre_hook.sh', 'root');
29282931
chmod('/usr/local/bin/letsencrypt_pre_hook.sh', 0700);
29292932
}
29302933
if(file_exists(ISPC_INSTALL_ROOT . '/server/scripts/letsencrypt_post_hook.sh') && !file_exists('/usr/local/bin/letsencrypt_post_hook.sh')) {
2934+
if(is_link('/usr/local/bin/letsencrypt_post_hook.sh')) {
2935+
unlink('/usr/local/bin/letsencrypt_post_hook.sh');
2936+
}
29312937
symlink(ISPC_INSTALL_ROOT . '/server/scripts/letsencrypt_post_hook.sh', '/usr/local/bin/letsencrypt_post_hook.sh');
29322938
chown('/usr/local/bin/letsencrypt_post_hook.sh', 'root');
29332939
chmod('/usr/local/bin/letsencrypt_post_hook.sh', 0700);
29342940
}
29352941
if(file_exists(ISPC_INSTALL_ROOT . '/server/scripts/letsencrypt_renew_hook.sh') && !file_exists('/usr/local/bin/letsencrypt_renew_hook.sh')) {
2942+
if(is_link('/usr/local/bin/letsencrypt_renew_hook.sh')) {
2943+
unlink('/usr/local/bin/letsencrypt_renew_hook.sh');
2944+
}
29362945
symlink(ISPC_INSTALL_ROOT . '/server/scripts/letsencrypt_renew_hook.sh', '/usr/local/bin/letsencrypt_renew_hook.sh');
29372946
chown('/usr/local/bin/letsencrypt_renew_hook.sh', 'root');
29382947
chmod('/usr/local/bin/letsencrypt_renew_hook.sh', 0700);

0 commit comments

Comments
 (0)