mariadb-install.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2021-2023 tteck
  3. # Author: tteck (tteckster)
  4. # License: MIT
  5. # https://github.com/tteck/Proxmox/raw/main/LICENSE
  6. source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
  7. color
  8. verb_ip6
  9. catch_errors
  10. setting_up_container
  11. network_check
  12. update_os
  13. msg_info "Installing Dependencies"
  14. $STD apt-get install -y curl
  15. $STD apt-get install -y sudo
  16. $STD apt-get install -y mc
  17. msg_ok "Installed Dependencies"
  18. msg_info "Installing MariaDB"
  19. $STD bash <(curl -fsSL https://r.mariadb.com/downloads/mariadb_repo_setup)
  20. $STD apt-get update
  21. $STD apt-get install -y mariadb-server
  22. sed -i 's/^# *\(port *=.*\)/\1/' /etc/mysql/my.cnf
  23. sed -i 's/^bind-address/#bind-address/g' /etc/mysql/mariadb.conf.d/50-server.cnf
  24. msg_ok "Installed MariaDB"
  25. read -r -p "Would you like to add Adminer? <y/N> " prompt
  26. if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
  27. msg_info "Installing Adminer"
  28. $STD apt install -y adminer
  29. $STD a2enconf adminer
  30. systemctl reload apache2
  31. msg_ok "Installed Adminer"
  32. fi
  33. motd_ssh
  34. customize
  35. msg_info "Cleaning up"
  36. $STD apt-get autoremove
  37. $STD apt-get autoclean
  38. msg_ok "Cleaned"