webmin.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/bash
  2. Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
  3. Info="${Green_font_prefix}[Installed]${Font_color_suffix}"
  4. Error="${Red_font_prefix}[Not Installed]${Font_color_suffix}"
  5. cek=$(netstat -ntlp | grep 10000 | awk '{print $7}' | cut -d'/' -f2)
  6. function install () {
  7. IP=$(wget -qO- ifconfig.co);
  8. echo " Adding Repositori Webmin"
  9. sh -c 'echo "deb http://download.webmin.com/download/repository sarge contrib" > /etc/apt/sources.list.d/webmin.list'
  10. apt install gnupg gnupg1 gnupg2 -y
  11. wget http://www.webmin.com/jcameron-key.asc
  12. apt-key add jcameron-key.asc
  13. echo " Start Install Webmin"
  14. clear
  15. sleep 0.5
  16. apt update > /dev/null 2>&1
  17. apt install webmin -y
  18. sed -i 's/ssl=1/ssl=0/g' /etc/webmin/miniserv.conf
  19. /etc/init.d/webmin restart
  20. rm -f /root/jcameron-key.asc
  21. clear
  22. echo ""
  23. echo " Done Install Webmin"
  24. echo " $IP:10000"
  25. echo " AutoScriptVPS By RIDZVPN"
  26. }
  27. function restart () {
  28. echo " Restarting Webmin"
  29. sleep 0.5
  30. service webmin restart > /dev/null 2>&1
  31. echo " Start Uninstall Webmin"
  32. clear
  33. echo ""
  34. echo " Done Restart Webmin"
  35. echo " AutoScriptVPS By RIDZVPN"
  36. }
  37. function uninstall () {
  38. echo " Removing Repositori Webmin"
  39. rm -f /etc/apt/sources.list.d/webmin.list
  40. apt update > /dev/null 2>&1
  41. echo " Start Uninstall Webmin"
  42. clear
  43. sleep 0.5
  44. apt autoremove --purge webmin -y > /dev/null 2>&1
  45. clear
  46. echo ""
  47. echo " Done Uninstall Webmin"
  48. echo " AutoScriptVPS By RIDZVPN"
  49. }
  50. if [[ "$cek" = "perl" ]]; then
  51. sts="${Info}"
  52. else
  53. sts="${Error}"
  54. fi
  55. clear
  56. echo -e " =============================="
  57. echo -e " Webmin Menu "
  58. echo -e " =============================="
  59. echo -e " Status $sts"
  60. echo -e " 1. Install Webmin"
  61. echo -e " 2. Restart Webmin"
  62. echo -e " 3. Uninstall Webmin"
  63. echo -e " AutoScriptVPS By RIDZVPN"
  64. echo -e " Press CTRL+C to return"
  65. read -rp " Please Enter The Correct Number : " -e num
  66. if [[ "$num" = "1" ]]; then
  67. install
  68. elif [[ "$num" = "2" ]]; then
  69. restart
  70. elif [[ "$num" = "3" ]]; then
  71. uninstall
  72. else
  73. clear
  74. echo " You Entered The Wrong Number"
  75. menu
  76. fi