diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 9373d9ab795f2b72fd1e53e6185eeb6b9f66a660..c25774b7368f503249a8710696ca7ae7b1ef14c0 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -2853,21 +2853,21 @@ class installer_base { // This script is needed earlier to check and open http port 80 or standalone might fail // Make executable and temporary symlink latest letsencrypt pre, post and renew hook script before install - if(file_exists(dirname(getcwd()) . '/server/scripts/letsencrypt_pre_hook.sh') && !file_exists('/usr/local/bin/letsencrypt_pre_hook.sh')) { - symlink(dirname(getcwd()) . '/server/scripts/letsencrypt_pre_hook.sh', '/usr/local/bin/letsencrypt_pre_hook.sh'); + if(file_exists(ISPC_INSTALL_ROOT . '/server/scripts/letsencrypt_pre_hook.sh') && !file_exists('/usr/local/bin/letsencrypt_pre_hook.sh')) { + symlink(ISPC_INSTALL_ROOT . '/server/scripts/letsencrypt_pre_hook.sh', '/usr/local/bin/letsencrypt_pre_hook.sh'); + chown('/usr/local/bin/letsencrypt_pre_hook.sh', 'root'); + chmod('/usr/local/bin/letsencrypt_pre_hook.sh', 0700); } - if(file_exists(dirname(getcwd()) . '/server/scripts/letsencrypt_post_hook.sh') && !file_exists('/usr/local/bin/letsencrypt_post_hook.sh')) { - symlink(dirname(getcwd()) . '/server/scripts/letsencrypt_post_hook.sh', '/usr/local/bin/letsencrypt_post_hook.sh'); + if(file_exists(ISPC_INSTALL_ROOT . '/server/scripts/letsencrypt_post_hook.sh') && !file_exists('/usr/local/bin/letsencrypt_post_hook.sh')) { + symlink(ISPC_INSTALL_ROOT . '/server/scripts/letsencrypt_post_hook.sh', '/usr/local/bin/letsencrypt_post_hook.sh'); + chown('/usr/local/bin/letsencrypt_post_hook.sh', 'root'); + chmod('/usr/local/bin/letsencrypt_post_hook.sh', 0700); } - if(file_exists(dirname(getcwd()) . '/server/scripts/letsencrypt_renew_hook.sh') && !file_exists('/usr/local/bin/letsencrypt_renew_hook.sh')) { - symlink(dirname(getcwd()) . '/server/scripts/letsencrypt_renew_hook.sh', '/usr/local/bin/letsencrypt_renew_hook.sh'); + if(file_exists(ISPC_INSTALL_ROOT . '/server/scripts/letsencrypt_renew_hook.sh') && !file_exists('/usr/local/bin/letsencrypt_renew_hook.sh')) { + symlink(ISPC_INSTALL_ROOT . '/server/scripts/letsencrypt_renew_hook.sh', '/usr/local/bin/letsencrypt_renew_hook.sh'); + chown('/usr/local/bin/letsencrypt_renew_hook.sh', 'root'); + chmod('/usr/local/bin/letsencrypt_renew_hook.sh', 0700); } - chown('/usr/local/bin/letsencrypt_pre_hook.sh', 'root'); - chown('/usr/local/bin/letsencrypt_post_hook.sh', 'root'); - chown('/usr/local/bin/letsencrypt_renew_hook.sh', 'root'); - chmod('/usr/local/bin/letsencrypt_pre_hook.sh', 0700); - chmod('/usr/local/bin/letsencrypt_post_hook.sh', 0700); - chmod('/usr/local/bin/letsencrypt_renew_hook.sh', 0700); // Check http port 80 status as it cannot be determined at post hook stage $port80_status=exec('true &>/dev/null