File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -2846,10 +2846,21 @@ public function make_ispconfig_ssl_cert() {
28462846 $ acme = explode ("\n" , shell_exec ('which /usr/local/ispconfig/server/scripts/acme.sh /root/.acme.sh/acme.sh ' ));
28472847 $ acme = reset ($ acme );
28482848
2849+ $ restore_conf_symlink = false ;
2850+
2851+ // we only need this for apache, so use fixed conf index
2852+ $ vhost_conf_dir = $ conf ['apache ' ]['vhost_conf_dir ' ];
2853+ $ vhost_conf_enabled_dir = $ conf ['apache ' ]['vhost_conf_enabled_dir ' ];
2854+
28492855 // first of all create the acme vhosts if not existing
28502856 if ($ conf ['nginx ' ]['installed ' ] == true ) {
28512857 $ this ->make_acme_vhost ($ hostname , 'nginx ' );
28522858 } elseif ($ conf ['apache ' ]['installed ' ] == true ) {
2859+ if ($ this ->is_update == false && @is_link ($ vhost_conf_enabled_dir .'/000-ispconfig.conf ' )) {
2860+ $ restore_conf_symlink = true ;
2861+ unlink ($ vhost_conf_enabled_dir .'/000-ispconfig.conf ' );
2862+ }
2863+
28532864 $ this ->make_acme_vhost ($ hostname , 'apache ' );
28542865 }
28552866
@@ -2896,6 +2907,12 @@ public function make_ispconfig_ssl_cert() {
28962907 exec ("$ le_client $ certonly $ acme_version --standalone --email postmaster@ $ hostname -d $ hostname $ hook " );
28972908 }
28982909 }
2910+
2911+ if ($ restore_conf_symlink ) {
2912+ if (!@is_link ($ vhost_conf_enabled_dir .'/000-ispconfig.conf ' )) {
2913+ symlink ($ vhost_conf_dir .'/ispconfig.conf ' , $ vhost_conf_enabled_dir .'/000-ispconfig.conf ' );
2914+ }
2915+ }
28992916 }
29002917
29012918 //* Define and check ISPConfig SSL folder */
You can’t perform that action at this time.
0 commit comments