From b409258a0ad449299509fc11ed0ad5c358e80521 Mon Sep 17 00:00:00 2001 From: Marius Burkard Date: Mon, 28 Sep 2020 09:54:54 +0200 Subject: [PATCH] - use installation root constant instead of cwd --- install/lib/installer_base.lib.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 9373d9ab79..c25774b736 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