@@ -436,7 +436,7 @@ public function add_database_server_record() {
436436 $ tpl_ini_array ['fastcgi ' ]['fastcgi_bin ' ] = $ conf ['fastcgi ' ]['fastcgi_bin ' ];
437437 $ tpl_ini_array ['server ' ]['hostname ' ] = $ conf ['hostname ' ];
438438 $ tpl_ini_array ['server ' ]['ip_address ' ] = @gethostbyname ($ conf ['hostname ' ]);
439- $ tpl_ini_array ['server ' ]['firewall ' ] = ($ conf ['ufw ' ]['installed ' ] == true )?'ufw ' :'bastille ' ;
439+ $ tpl_ini_array ['server ' ]['firewall ' ] = (@ $ conf ['ufw ' ]['installed ' ] == true )?'ufw ' :'bastille ' ;
440440 $ tpl_ini_array ['web ' ]['website_basedir ' ] = $ conf ['web ' ]['website_basedir ' ];
441441 $ tpl_ini_array ['web ' ]['website_path ' ] = $ conf ['web ' ]['website_path ' ];
442442 $ tpl_ini_array ['web ' ]['website_symlinks ' ] = $ conf ['web ' ]['website_symlinks ' ];
@@ -2615,21 +2615,23 @@ public function configure_bastille_firewall() {
26152615
26162616 $ row = $ this ->db ->queryOneRecord ('SELECT * FROM ?? WHERE server_id = ? ' , $ conf ["mysql " ]["database " ] . '.firewall ' , $ conf ['server_id ' ]);
26172617
2618- if (trim ($ row ['tcp_port ' ]) != '' || trim ($ row ['udp_port ' ]) != '' ) {
2619- $ tcp_public_services = trim (str_replace (', ' , ' ' , $ row ['tcp_port ' ]));
2620- $ udp_public_services = trim (str_replace (', ' , ' ' , $ row ['udp_port ' ]));
2621- } else {
2622- $ tcp_public_services = '21 22 25 53 80 110 143 443 3306 8080 10000 ' ;
2623- $ udp_public_services = '53 ' ;
2624- }
2618+ if (!empty ($ row )) {
2619+ if (trim ($ row ['tcp_port ' ]) != '' || trim ($ row ['udp_port ' ]) != '' ) {
2620+ $ tcp_public_services = trim (str_replace (', ' , ' ' , $ row ['tcp_port ' ]));
2621+ $ udp_public_services = trim (str_replace (', ' , ' ' , $ row ['udp_port ' ]));
2622+ } else {
2623+ $ tcp_public_services = '21 22 25 53 80 110 143 443 3306 8080 10000 ' ;
2624+ $ udp_public_services = '53 ' ;
2625+ }
26252626
2626- if (!stristr ($ tcp_public_services , $ conf ['apache ' ]['vhost_port ' ])) {
2627- $ tcp_public_services .= ' ' .intval ($ conf ['apache ' ]['vhost_port ' ]);
2628- if ($ row ['tcp_port ' ] != '' ) $ this ->db ->query ("UPDATE firewall SET tcp_port = tcp_port + ? WHERE server_id = ? " , ', ' . intval ($ conf ['apache ' ]['vhost_port ' ]), $ conf ['server_id ' ]);
2629- }
2627+ if (!stristr ($ tcp_public_services , $ conf ['apache ' ]['vhost_port ' ])) {
2628+ $ tcp_public_services .= ' ' .intval ($ conf ['apache ' ]['vhost_port ' ]);
2629+ if ($ row ['tcp_port ' ] != '' ) $ this ->db ->query ("UPDATE firewall SET tcp_port = tcp_port + ? WHERE server_id = ? " , ', ' . intval ($ conf ['apache ' ]['vhost_port ' ]), $ conf ['server_id ' ]);
2630+ }
26302631
2631- $ content = str_replace ('{TCP_PUBLIC_SERVICES} ' , $ tcp_public_services , $ content );
2632- $ content = str_replace ('{UDP_PUBLIC_SERVICES} ' , $ udp_public_services , $ content );
2632+ $ content = str_replace ('{TCP_PUBLIC_SERVICES} ' , $ tcp_public_services , $ content );
2633+ $ content = str_replace ('{UDP_PUBLIC_SERVICES} ' , $ udp_public_services , $ content );
2634+ }
26332635
26342636 wf ('/etc/Bastille/bastille-firewall.cfg ' , $ content );
26352637
@@ -3823,6 +3825,12 @@ public function install_ispconfig() {
38233825 if (!is_link ('/usr/local/bin/ispconfig_update_from_dev.sh ' )) symlink ($ install_dir .'/server/scripts/ispconfig_update.sh ' , '/usr/local/bin/ispconfig_update_from_dev.sh ' );
38243826 if (!is_link ('/usr/local/bin/ispconfig_update.sh ' )) symlink ($ install_dir .'/server/scripts/ispconfig_update.sh ' , '/usr/local/bin/ispconfig_update.sh ' );
38253827
3828+ // Install ISPConfig cli command
3829+ if (is_file ('/usr/local/bin/ispc ' )) unlink ('/usr/local/bin/ispc ' );
3830+ chown ($ install_dir .'/server/cli/ispc ' , 'root ' );
3831+ chmod ($ install_dir .'/server/cli/ispc ' , 0700 );
3832+ symlink ($ install_dir .'/server/cli/ispc ' , '/usr/local/bin/ispc ' );
3833+
38263834 // Make executable then unlink and symlink letsencrypt pre, post and renew hook scripts
38273835 chown ($ install_dir .'/server/scripts/letsencrypt_pre_hook.sh ' , 'root ' );
38283836 chown ($ install_dir .'/server/scripts/letsencrypt_post_hook.sh ' , 'root ' );
0 commit comments