diff --git a/AppendCMS.sh b/AppendCMS.sh index f930c62..6628ed1 100644 --- a/AppendCMS.sh +++ b/AppendCMS.sh @@ -274,4 +274,4 @@ systemctl reload fail2ban ##-------## msg " Added CMS!" -for f in /etc/update-motd.d/51*; do bash $f; done \ No newline at end of file +if stat --printf='' /etc/update-motd.d/51* 2>/dev/null; then for f in /etc/update-motd.d/51*; do bash $f; done; fi \ No newline at end of file diff --git a/AppendModule.sh b/AppendModule.sh index c011fe6..856b84b 100644 --- a/AppendModule.sh +++ b/AppendModule.sh @@ -267,4 +267,4 @@ done ##-------## msg " Added Module!" -for f in /etc/update-motd.d/51*; do bash $f; done \ No newline at end of file +if stat --printf='' /etc/update-motd.d/51* 2>/dev/null; then for f in /etc/update-motd.d/51*; do bash $f; done; fi \ No newline at end of file diff --git a/CoreModules/generic/conf.sh b/CoreModules/generic/conf.sh index 9bf57dd..f119e35 100644 --- a/CoreModules/generic/conf.sh +++ b/CoreModules/generic/conf.sh @@ -1,12 +1,17 @@ -##--------------------## -# (Centos) SeLinux # -##--------------------## +##----------## +# Centos # +##----------## if [ "$shortdist" = "cent8" ]; then + #SeLinux semanage port -a -t ssh_port_t -p tcp 4242 systemctl enable ufw > $OUTPUT 2>&1 mkdir /var/www > $OUTPUT 2>&1 semanage fcontext -a -t httpd_sys_content_t /var/www/ > $OUTPUT 2>&1 restorecon -vr /var/www/ > $OUTPUT 2>&1 + + #Motd + mkdir /etc/update-motd.d + echo 'if stat --printf="" /etc/update-motd.d/51* 2>/dev/null; then for f in /etc/update-motd.d/51*; do bash $f; done; fi' >> /etc/profile fi ##-------## diff --git a/installer.sh b/installer.sh index de58f1f..820e304 100644 --- a/installer.sh +++ b/installer.sh @@ -700,4 +700,4 @@ systemctl reload sshd fail2ban ##-------## msg " Done installing!" -for f in /etc/update-motd.d/51*; do bash $f; done \ No newline at end of file +if stat --printf='' /etc/update-motd.d/51* 2>/dev/null; then for f in /etc/update-motd.d/51*; do bash $f; done; fi \ No newline at end of file