webmin.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. function header_info {
  7. clear
  8. cat <<"EOF"
  9. _ __ __ _
  10. | | /| / /__ / / __ _ (_)__
  11. | |/ |/ / -_) _ \/ ' \/ / _ \
  12. |__/|__/\__/_.__/_/_/_/_/_//_/
  13. EOF
  14. }
  15. set -eEuo pipefail
  16. YW=$(echo "\033[33m")
  17. BL=$(echo "\033[36m")
  18. BGN=$(echo "\033[4;92m")
  19. GN=$(echo "\033[1;92m")
  20. DGN=$(echo "\033[32m")
  21. CL=$(echo "\033[m")
  22. CM="${GN}✓${CL}"
  23. BFR="\\r\\033[K"
  24. HOLD="-"
  25. msg_info() {
  26. local msg="$1"
  27. echo -ne " ${HOLD} ${YW}${msg}..."
  28. }
  29. msg_ok() {
  30. local msg="$1"
  31. echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
  32. }
  33. header_info
  34. whiptail --backtitle "Proxmox VE Helper Scripts" --title "Webmin Installer" --yesno "This Will Install Webmin on this LXC Container. Proceed?" 10 58 || exit
  35. msg_info "Installing Prerequisites"
  36. apt update &>/dev/null
  37. apt-get -y install libnet-ssleay-perl libauthen-pam-perl libio-pty-perl unzip shared-mime-info &>/dev/null
  38. msg_ok "Installed Prerequisites"
  39. LATEST=$(curl -sL https://api.github.com/repos/webmin/webmin/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
  40. msg_info "Downloading Webmin"
  41. wget -q https://github.com/webmin/webmin/releases/download/$LATEST/webmin_${LATEST}_all.deb
  42. msg_ok "Downloaded Webmin"
  43. msg_info "Installing Webmin"
  44. dpkg -i webmin_${LATEST}_all.deb &>/dev/null
  45. /usr/share/webmin/changepass.pl /etc/webmin root root &>/dev/null
  46. rm -rf /root/webmin_${LATEST}_all.deb
  47. msg_ok "Installed Webmin"
  48. IP=$(hostname -I | cut -f1 -d ' ')
  49. echo -e "Successfully Installed!! Webmin should be reachable by going to ${BL}https://${IP}:10000${CL}"