1.2.2.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/sh
  2. # Hestia Control Panel upgrade script for target version 1.2.2
  3. #######################################################################################
  4. ####### Place additional commands below. #######
  5. #######################################################################################
  6. # Enhance Vsftpd security
  7. if [ "$FTP_SYSTEM" = "vsftpd" ]; then
  8. echo "[ ! ] Hardening Vsftpd TLS configuration..."
  9. if [ -e /etc/vsftpd.conf ]; then
  10. rm -f /etc/vsftpd.conf
  11. fi
  12. cp -f $HESTIA_INSTALL_DIR/vsftpd/vsftpd.conf /etc/
  13. chmod 644 /etc/vsftpd.conf
  14. fi
  15. # Rework apt repositories
  16. apt="/etc/apt/sources.list.d"
  17. echo "[ * ] Hardening APT repositories..."
  18. if [ -f "$apt/nginx.list" ]; then
  19. if grep -q "http://nginx.org/packages/mainline/" $apt/nginx.list; then
  20. echo " ----- NGINX"
  21. sed -i "s/http\:\/\/nginx.org/https\:\/\/nginx.org/g" $apt/nginx.list
  22. fi
  23. fi
  24. if [ -f "$apt/php.list" ]; then
  25. if grep -q "http://packages.sury.org/" $apt/php.list; then
  26. echo " ----- PHP"
  27. sed -i "s/http\:\/\/packages.sury.org/https\:\/\/packages.sury.org/g" $apt/php.list
  28. fi
  29. fi
  30. if [ -f "$apt/mariadb.list" ]; then
  31. if grep -q "http://ams2.mirrors.digitalocean.com" $apt/mariadb.list; then
  32. echo " ----- MariaDB"
  33. sed -i "s/http\:\/\/ams2.mirrors.digitalocean.com/https\:\/\/mirror.mva-n.net/g" $apt/mariadb.list
  34. fi
  35. fi
  36. if [ -f "$apt/postgresql.list" ]; then
  37. if grep -q "http://apt.postgresql.org" $apt/postgresql.list; then
  38. echo " ----- PostgreSQL"
  39. sed -i "s/http\:\/\/apt.postgresql.org/https\:\/\/apt.postgresql.org/g" $apt/postgresql.list
  40. fi
  41. fi