From 8ad35db68523db32c872340d3f2ebcc5ab231968 Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Thu, 15 Oct 2020 12:20:23 +0200 Subject: [PATCH] updated postfix module and fixed CMS motd --- CMS/nextcloud/conf.sh | 6 +++--- CMS/nextcloud/nextcloud-init.sh | 2 +- CMS/nextcloud/nginx-conf.sh | 2 +- CMS/wordpress/conf.sh | 6 +++--- CMS/wordpress/wordpress-init.sh | 2 +- CoreModules/nginx/conf.sh | 4 ++-- SubModules/postfix/conf.sh | 4 +++- SubModules/postfix/preconf.sh | 9 +++++++++ installer.sh | 2 +- 9 files changed, 24 insertions(+), 13 deletions(-) diff --git a/CMS/nextcloud/conf.sh b/CMS/nextcloud/conf.sh index 9927359..fae000f 100644 --- a/CMS/nextcloud/conf.sh +++ b/CMS/nextcloud/conf.sh @@ -41,9 +41,9 @@ chown "$sitename":"$sitename" -R /var/www/"$domain"/html #Makeing nextcloud Finalize script and setting login Notice curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/nextcloud-init.sh -o ~/NextcloudInit-"$sitename".sh sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' ~/NextcloudInit-"$sitename".sh -curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/MotdNextCloud -o /etc/update-motd.d/51-nextnotice -sed -i -e 's/SITEname/'$sitename'/' /etc/update-motd.d/51-nextnotice -chmod +x /etc/update-motd.d/51-nextnotice +curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/MotdNextCloud -o /etc/update-motd.d/51-nextnotice-"$sitename" +sed -i -e 's/SITEname/'$sitename'/' /etc/update-motd.d/51-nextnotice-"$sitename" +chmod +x /etc/update-motd.d/51-nextnotice-"$sitename" #Nextcloud logging location diff --git a/CMS/nextcloud/nextcloud-init.sh b/CMS/nextcloud/nextcloud-init.sh index f298cba..a32f13b 100644 --- a/CMS/nextcloud/nextcloud-init.sh +++ b/CMS/nextcloud/nextcloud-init.sh @@ -17,7 +17,7 @@ else fi echo "*/5 * * * * SITEname php -f /var/www/DOMAINname/html/cron.php > /dev/null 2>&1" >> /etc/crontab -rm -f /etc/update-motd.d/51-nextnotice +rm -f /etc/update-motd.d/51-nextnotice-SITEname #Remove script while true; do diff --git a/CMS/nextcloud/nginx-conf.sh b/CMS/nextcloud/nginx-conf.sh index 3c2ccfc..98a9b6b 100644 --- a/CMS/nextcloud/nginx-conf.sh +++ b/CMS/nextcloud/nginx-conf.sh @@ -4,7 +4,7 @@ curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/Nginx-unconfigured -o /tmp/nginx-siteconf sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/g' -e 's/SITEname/'$sitename'/g' /tmp/nginx-siteconf sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-siteconf' -e '/#ConfHere/c\' /etc/nginx/sites-available/"$sitename"_"$site_ext" -if [ $sslenable = 0 ]; then +if [ $site_ext = nossl ]; then sed -i -e '/fastcgi_param HTTPS/c\# fastcgi_param HTTPS' /etc/nginx/sites-available/"$sitename"_nossl fi diff --git a/CMS/wordpress/conf.sh b/CMS/wordpress/conf.sh index 9aa7df7..92d895f 100644 --- a/CMS/wordpress/conf.sh +++ b/CMS/wordpress/conf.sh @@ -50,6 +50,6 @@ chown "$sitename":"$sitename" -R /var/www/"$domain"/html #Makeing wordpress Finalize script and setting login Notice curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/wordpress-init.sh -o ~/WordpressInit-"$sitename".sh sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' ~/WordpressInit-"$sitename".sh -curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/MotdWordpress -o /etc/update-motd.d/51-wpnotice -sed -i -e 's/SITEname/'$sitename'/' /etc/update-motd.d/51-wpnotice -chmod +x /etc/update-motd.d/51-wpnotice \ No newline at end of file +curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/MotdWordpress -o /etc/update-motd.d/51-wpnotice-"$sitename" +sed -i -e 's/SITEname/'$sitename'/' /etc/update-motd.d/51-wpnotice-"$sitename" +chmod +x /etc/update-motd.d/51-wpnotice-"$sitename" \ No newline at end of file diff --git a/CMS/wordpress/wordpress-init.sh b/CMS/wordpress/wordpress-init.sh index 2e3dc17..42d3ef5 100644 --- a/CMS/wordpress/wordpress-init.sh +++ b/CMS/wordpress/wordpress-init.sh @@ -6,7 +6,7 @@ sudo -u SITEname wp --path=/var/www/DOMAINname/html plugin install https://git.i sudo -u SITEname wp --path=/var/www/DOMAINname/html cron event run wp_update_plugins sudo -u SITEname wp --path=/var/www/DOMAINname/html plugin update --all echo -e "\e[96m Please update all-in-one-wp-migration-unlimited plugin manually\e[39m" -rm -f /etc/update-motd.d/51-wpnotice +rm -f /etc/update-motd.d/51-wpnotice-SITEname #Remove script while true; do diff --git a/CoreModules/nginx/conf.sh b/CoreModules/nginx/conf.sh index a5f9c6d..f89545a 100644 --- a/CoreModules/nginx/conf.sh +++ b/CoreModules/nginx/conf.sh @@ -37,8 +37,8 @@ curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModule sed -i -e 's/DOMAINname/'$hostname'/g' /etc/nginx/sites-available/Backend_ssl mkdir -p /opt/toggle -curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-Netdata_NGINX.sh -O /opt/toggle/toggle-Netdata.sh -curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-PhpMyAdmin_NGINX.sh -O /opt/toggle/toggle-PhpMyAdmin.sh +curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-Netdata_NGINX.sh -o /opt/toggle/toggle-Netdata.sh +curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-PhpMyAdmin_NGINX.sh -o /opt/toggle/toggle-PhpMyAdmin.sh # custom Welcome page echo "$webserv is functioning normally" > /usr/share/nginx/html/index.html diff --git a/SubModules/postfix/conf.sh b/SubModules/postfix/conf.sh index 83d8ea1..4e10837 100644 --- a/SubModules/postfix/conf.sh +++ b/SubModules/postfix/conf.sh @@ -11,4 +11,6 @@ cat < /etc/aliases postmaster: root root: $email EOF -newaliases \ No newline at end of file +newaliases + +systemctl reload postfix postfix@- \ No newline at end of file diff --git a/SubModules/postfix/preconf.sh b/SubModules/postfix/preconf.sh index facd203..3dae6a3 100644 --- a/SubModules/postfix/preconf.sh +++ b/SubModules/postfix/preconf.sh @@ -1,2 +1,11 @@ +if [ -z "${domain}" ]; then + if [ $IMODE = n ]; then + domain=$(whiptail --nocancel --inputbox " Enter the domain without WWW " 11 82 --title "Config" 3>&1 1>&2 2>&3) + elif [ $IMODE = l ]; then + echo "Enter the domain without WWW:" + read domain + fi +fi + debconf-set-selections <<< "postfix postfix/mailname string $domain" debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet Site'" \ No newline at end of file diff --git a/installer.sh b/installer.sh index 068fe0d..390dd56 100644 --- a/installer.sh +++ b/installer.sh @@ -700,7 +700,7 @@ fi # Services # ##------------## -systemctl reload sshd fail2ban postfix postfix@- +systemctl reload sshd fail2ban ##-------##