VPS-MX-ENGLISH.sh 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. #!/bin/bash
  2. clear && clear
  3. cd $HOME
  4. RutaBin="/bin"
  5. apt install net-tools -y &>/dev/null
  6. echo "nameserver 1.1.1.1" >/etc/resolv.conf
  7. echo "nameserver 1.0.0.1" >>/etc/resolv.conf
  8. myip=$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0' | head -n1)
  9. myint=$(ifconfig | grep -B1 "inet addr:$myip" | head -n1 | awk '{print $1}')
  10. rm -rf /etc/localtime &>/dev/null
  11. ln -s /usr/share/zoneinfo/America/Mexico_City /etc/localtime &>/dev/null
  12. rm -rf /usr/local/lib/systemubu1 &>/dev/null
  13. ### COLORES Y BARRA
  14. msg() {
  15. BRAN='\033[1;37m' && VERMELHO='\e[31m' && VERDE='\e[32m' && AMARELO='\e[33m'
  16. AZUL='\e[34m' && MAGENTA='\e[35m' && MAG='\033[1;36m' && NEGRITO='\e[1m' && SEMCOR='\e[0m'
  17. case $1 in
  18. -ne) cor="${VERMELHO}${NEGRITO}" && echo -ne "${cor}${2}${SEMCOR}" ;;
  19. -ama) cor="${AMARELO}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
  20. -verm) cor="${AMARELO}${NEGRITO}[!] ${VERMELHO}" && echo -e "${cor}${2}${SEMCOR}" ;;
  21. -azu) cor="${MAG}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
  22. -verd) cor="${VERDE}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
  23. -bra) cor="${VERMELHO}" && echo -ne "${cor}${2}${SEMCOR}" ;;
  24. "-bar2" | "-bar") cor="${VERMELHO}————————————————————————————————————————————————————" && echo -e "${SEMCOR}${cor}${SEMCOR}" ;;
  25. esac
  26. }
  27. fun_bar() {
  28. comando="$1"
  29. _=$(
  30. $comando >/dev/null 2>&1
  31. ) &
  32. >/dev/null
  33. pid=$!
  34. while [[ -d /proc/$pid ]]; do
  35. echo -ne " \033[1;33m["
  36. for ((i = 0; i < 20; i++)); do
  37. echo -ne "\033[1;31m##"
  38. sleep 0.5
  39. done
  40. echo -ne "\033[1;33m]"
  41. sleep 1s
  42. echo
  43. tput cuu1
  44. tput dl1
  45. done
  46. echo -e " \033[1;33m[\033[1;31m########################################\033[1;33m] - \033[1;32m100%\033[0m"
  47. sleep 1s
  48. }
  49. install_paketes() {
  50. clear && clear
  51. ### PAQUETES PRINCIPALES
  52. msg -bar2
  53. msg -ama " [ VPS-MX-ENGLISH \033[1;97m ❌ translate by Rukshan ❌\033[1;33m ]"
  54. msg -bar
  55. echo -e "\033[97m"
  56. echo -e " \033[41m -- INSTALLATION OF PACKAGES FOR VPS-MX -- \e[49m"
  57. echo -e "\033[97m"
  58. msg -bar
  59. echo -e " Installing, this may take a few minutes... "
  60. msg -bar
  61. #grep
  62. apt-get install netcat -y &>/dev/null
  63. apt-get install netpipes -y &>/dev/null
  64. apt-get install grep -y &>/dev/null
  65. apt-get install net-tools -y &>/dev/null
  66. sudo add-apt-repository universe &>/dev/null
  67. sudo apt-get install netcat-traditional -y &>/dev/null
  68. sudo add-apt-repository main -y &>/dev/null
  69. sudo add-apt-repository universe -y &>/dev/null
  70. sudo add-apt-repository restricted -y &>/dev/null
  71. sudo add-apt-repository multiverse -y &>/dev/null
  72. sudo apt-get install software-properties-common -y &>/dev/null
  73. sudo add-apt-repository ppa:neurobin/ppa -y &>/dev/null
  74. sudo apt-get install build-essential -y &>/dev/null
  75. apt-get install shc &>/dev/null
  76. #grep
  77. apt-get install grep -y &>/dev/null
  78. [[ $(dpkg --get-selections|grep -w "grep"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  79. [[ $(dpkg --get-selections|grep -w "grep"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  80. echo -e "\033[97m # apt-get install grep............ $ESTATUS "
  81. #gawk
  82. apt-get install gawk -y &>/dev/null
  83. [[ $(dpkg --get-selections|grep -w "gawk"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  84. [[ $(dpkg --get-selections|grep -w "gawk"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  85. echo -e "\033[97m # apt-get install gawk............ $ESTATUS "
  86. #mlocate
  87. apt-get install mlocate -y &>/dev/null
  88. [[ $(dpkg --get-selections|grep -w "mlocate"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  89. [[ $(dpkg --get-selections|grep -w "mlocate"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  90. echo -e "\033[97m # apt-get install mlocate......... $ESTATUS "
  91. #lolcat gem
  92. apt-get install lolcat -y &>/dev/null
  93. sudo gem install lolcat &>/dev/null
  94. [[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  95. [[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  96. echo -e "\033[97m # apt-get install lolcat.......... $ESTATUS "
  97. #at
  98. [[ $(dpkg --get-selections|grep -w "at"|head -1) ]] || apt-get install at -y &>/dev/null
  99. [[ $(dpkg --get-selections|grep -w "at"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  100. [[ $(dpkg --get-selections|grep -w "at"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  101. echo -e "\033[97m # apt-get install at.............. $ESTATUS "
  102. #nano
  103. [[ $(dpkg --get-selections|grep -w "nano"|head -1) ]] || apt-get install nano -y &>/dev/null
  104. [[ $(dpkg --get-selections|grep -w "nano"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  105. [[ $(dpkg --get-selections|grep -w "nano"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  106. echo -e "\033[97m # apt-get install nano............ $ESTATUS "
  107. #bc
  108. [[ $(dpkg --get-selections|grep -w "bc"|head -1) ]] || apt-get install bc -y &>/dev/null
  109. [[ $(dpkg --get-selections|grep -w "bc"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  110. [[ $(dpkg --get-selections|grep -w "bc"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  111. ## systemedia &> /dev/null
  112. echo -e "\033[97m # apt-get install bc.............. $ESTATUS "
  113. #lsof
  114. [[ $(dpkg --get-selections|grep -w "lsof"|head -1) ]] || apt-get install lsof -y &>/dev/null
  115. [[ $(dpkg --get-selections|grep -w "lsof"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  116. [[ $(dpkg --get-selections|grep -w "lsof"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  117. echo -e "\033[97m # apt-get install lsof............ $ESTATUS "
  118. #figlet
  119. [[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] || apt-get install figlet -y &>/dev/null
  120. [[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  121. [[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  122. echo -e "\033[97m # apt-get install figlet.......... $ESTATUS "
  123. #cowsay
  124. [[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] || apt-get install cowsay -y &>/dev/null
  125. [[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  126. [[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  127. echo -e "\033[97m # apt-get install cowsay.......... $ESTATUS "
  128. #screen
  129. [[ $(dpkg --get-selections|grep -w "screen"|head -1) ]] || apt-get install screen -y &>/dev/null
  130. [[ $(dpkg --get-selections|grep -w "screen"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  131. [[ $(dpkg --get-selections|grep -w "screen"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  132. echo -e "\033[97m # apt-get install screen.......... $ESTATUS "
  133. #python
  134. [[ $(dpkg --get-selections|grep -w "python"|head -1) ]] || apt-get install python -y &>/dev/null
  135. [[ $(dpkg --get-selections|grep -w "python"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  136. [[ $(dpkg --get-selections|grep -w "python"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  137. echo -e "\033[97m # apt-get install python.......... $ESTATUS "
  138. #python3
  139. [[ $(dpkg --get-selections|grep -w "python3"|head -1) ]] || apt-get install python3 -y &>/dev/null
  140. [[ $(dpkg --get-selections|grep -w "python3"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  141. [[ $(dpkg --get-selections|grep -w "python3"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  142. echo -e "\033[97m # apt-get install python3......... $ESTATUS "
  143. #python3-pip
  144. [[ $(dpkg --get-selections|grep -w "python3-pip"|head -1) ]] || apt-get install python3-pip -y &>/dev/null
  145. [[ $(dpkg --get-selections|grep -w "python3-pip"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  146. [[ $(dpkg --get-selections|grep -w "python3-pip"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  147. echo -e "\033[97m # apt-get install python3-pip..... $ESTATUS "
  148. #ufw
  149. [[ $(dpkg --get-selections|grep -w "ufw"|head -1) ]] || apt-get install ufw -y &>/dev/null
  150. [[ $(dpkg --get-selections|grep -w "ufw"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  151. [[ $(dpkg --get-selections|grep -w "ufw"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  152. echo -e "\033[97m # apt-get install ufw............. $ESTATUS "
  153. #unzip
  154. [[ $(dpkg --get-selections|grep -w "unzip"|head -1) ]] || apt-get install unzip -y &>/dev/null
  155. [[ $(dpkg --get-selections|grep -w "unzip"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  156. [[ $(dpkg --get-selections|grep -w "unzip"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  157. echo -e "\033[97m # apt-get install unzip........... $ESTATUS "
  158. #zip
  159. [[ $(dpkg --get-selections|grep -w "zip"|head -1) ]] || apt-get install zip -y &>/dev/null
  160. [[ $(dpkg --get-selections|grep -w "zip"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  161. [[ $(dpkg --get-selections|grep -w "zip"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  162. echo -e "\033[97m # apt-get install zip............. $ESTATUS "
  163. #apache2
  164. apt-get install apache2 -y &>/dev/null
  165. sed -i "s;Listen 80;Listen 81;g" /etc/apache2/ports.conf > /dev/null 2>&1
  166. service apache2 restart > /dev/null 2>&1
  167. # [[ $(dpkg --get-selections|grep -w "apache2"|head -1) ]] || {
  168. # apt-get install apache2 -y &>/dev/null
  169. # sed -i "s;Listen 80;Listen 81;g" /etc/apache2/ports.conf
  170. # service apache2 restart > /dev/null 2>&1 &
  171. # }
  172. [[ $(dpkg --get-selections|grep -w "apache2"|head -1) ]] || ESTATUS=`echo -e "\033[91mINSTALLATION FAILURE"` &>/dev/null
  173. [[ $(dpkg --get-selections|grep -w "apache2"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALLED"` &>/dev/null
  174. echo -e "\033[97m # apt-get install apache2......... $ESTATUS "
  175. apt-get install curl -y
  176. apt-get install lsof -y
  177. apt-get install sudo -y
  178. apt-get install figlet -y
  179. apt-get install cowsay -y
  180. apt-get install bc -y
  181. apt-get install python -y
  182. apt-get install at -y
  183. apt-get install apache2 -y
  184. sed -i "s;Listen 80;Listen 81;g" /etc/apache2/ports.conf
  185. service apache2 restart
  186. clear
  187. clear
  188. clear
  189. msg -bar2
  190. }
  191. install_paketes
  192. mkdir /etc/VPS-MX >/dev/null 2>&1
  193. cd /etc/
  194. wget https://raw.githubusercontent.com/rukshanchamindu/VPS-MX-ENGLISH/main/Files/VPS-MX.zip >/dev/null 2>&1
  195. unzip VPS-MX.zip >/dev/null 2>&1
  196. rm -rf VPS-MX.zip
  197. cd
  198. chmod -R 755 /etc/VPS-MX
  199. rm -rf /etc/VPS-MX/MEUIPvps
  200. echo "/etc/VPS-MX/menu" >/usr/bin/menu && chmod +x /usr/bin/menu
  201. echo "/etc/VPS-MX/menu" >/usr/bin/VPSMX && chmod +x /usr/bin/VPSMX
  202. [[ ! -d /usr/local/lib ]] && mkdir /usr/local/lib
  203. [[ ! -d /usr/local/lib/ubuntn ]] && mkdir /usr/local/lib/ubuntn
  204. [[ ! -d /usr/local/lib/ubuntn/apache ]] && mkdir /usr/local/lib/ubuntn/apache
  205. [[ ! -d /usr/local/lib/ubuntn/apache/ver ]] && mkdir /usr/local/lib/ubuntn/apache/ver
  206. [[ ! -d /usr/share ]] && mkdir /usr/share
  207. [[ ! -d /usr/share/mediaptre ]] && mkdir /usr/share/mediaptre
  208. [[ ! -d /usr/share/mediaptre/local ]] && mkdir /usr/share/mediaptre/local
  209. [[ ! -d /usr/share/mediaptre/local/log ]] && mkdir /usr/share/mediaptre/local/log
  210. [[ ! -d /usr/share/mediaptre/local/log/lognull ]] && mkdir /usr/share/mediaptre/local/log/lognull
  211. [[ ! -d /etc/VPS-MX/B-VPS-MXuser ]] && mkdir /etc/VPS-MX/B-VPS-MXuser
  212. [[ ! -d /usr/local/protec ]] && mkdir /usr/local/protec
  213. [[ ! -d /usr/local/protec/rip ]] && mkdir /usr/local/protec/rip
  214. [[ ! -d /etc/protecbin ]] && mkdir /etc/protecbin
  215. rm -rf /etc/VPS-MX/herramientas/speed.sh
  216. rm -rf /etc/VPS-MX/herramientas/speedtest.py
  217. cd /etc/VPS-MX/herramientas
  218. wget https://raw.githubusercontent.com/rukshanchamindu/VPS-MX-ENGLISH/main/Files/speedtest_v1.tar >/dev/null 2>&1
  219. tar -xf speedtest_v1.tar >/dev/null 2>&1
  220. rm -rf speedtest_v1.tar >/dev/null 2>&1
  221. cd
  222. [[ ! -d /etc/VPS-MX/v2ray ]] && mkdir /etc/VPS-MX/v2ray
  223. [[ ! -d /etc/VPS-MX/Slow ]] && mkdir /etc/VPS-MX/Slow
  224. [[ ! -d /etc/VPS-MX/Slow/install ]] && mkdir /etc/VPS-MX/Slow/install
  225. [[ ! -d /etc/VPS-MX/Slow/Key ]] && mkdir /etc/VPS-MX/Slow/Key
  226. msg -ama " Finishing Installation" && msg bar2
  227. [[ $(find /etc/VPS-MX/controlador -name nombre.log | grep -w "nombre.log" | head -1) ]] || wget -O /etc/VPS-MX/controlador/nombre.log https://github.com/rukshanchamindu/VPS-MX-ENGLISH/main/Files/nombre.log &>/dev/null
  228. [[ $(find /etc/VPS-MX/controlador -name IDT.log | grep -w "IDT.log" | head -1) ]] || wget -O /etc/VPS-MX/controlador/IDT.log https://github.com/rukshanchamindu/VPS-MX-ENGLISH/main/Files/IDT.log &>/dev/null
  229. [[ $(find /etc/VPS-MX/controlador -name tiemlim.log | grep -w "tiemlim.log" | head -1) ]] || wget -O /etc/VPS-MX/controlador/tiemlim.log https://github.com/rukshanchamindu/VPS-MX-ENGLISH/main/Files/tiemlim.log &>/dev/null
  230. touch /usr/share/lognull &>/dev/null
  231. wget https://raw.githubusercontent.com/rukshanchamindu/VPS-MX-ENGLISH/main/Files/SPR -O /usr/bin/SPR &>/dev/null &>/dev/null
  232. chmod 775 /usr/bin/SPR &>/dev/null
  233. wget -O /usr/bin/SOPORTE https://raw.githubusercontent.com/rukshanchamindu/VPS-MX-ENGLISH/main/Files/SOPORTE &>/dev/null
  234. chmod 775 /usr/bin/SOPORTE &>/dev/null
  235. SOPORTE &>/dev/null
  236. wget -O /bin/rebootnb https://raw.githubusercontent.com/rukshanchamindu/VPS-MX-ENGLISH/main/Files/rebootnb &>/dev/null
  237. chmod +x /bin/rebootnb
  238. wget -O /bin/resetsshdrop https://raw.githubusercontent.com/rukshanchamindu/VPS-MX-ENGLISH/main/Files/resetsshdrop &>/dev/null
  239. chmod +x /bin/resetsshdrop
  240. wget -O /bin/monitor.sh https://raw.githubusercontent.com/rukshanchamindu/VPS-MX-ENGLISH/main/Files/monitor.sh &> /dev/null
  241. chmod +x /bin/monitor.sh
  242. wget -O /etc/versin_script_new https://raw.githubusercontent.com/rukshanchamindu/VPS-MX-ENGLISH/main/Files/Version &>/dev/null
  243. grep -v "^PasswordAuthentication" /etc/ssh/sshd_config >/tmp/passlogin && mv /tmp/passlogin /etc/ssh/sshd_config
  244. echo "PasswordAuthentication yes" >>/etc/ssh/sshd_config
  245. v1=$(curl -sSL "https://raw.githubusercontent.com/rukshanchamindu/VPS-MX-ENGLISH/main/Files/Version")
  246. echo "$v1" > /etc/versin_script
  247. msg -bar2
  248. echo '#!/bin/sh -e' >/etc/rc.local
  249. sudo chmod +x /etc/rc.local
  250. echo "sudo rebootnb" >>/etc/rc.local
  251. echo "sudo resetsshdrop" >>/etc/rc.local
  252. echo "sleep 2s" >>/etc/rc.local
  253. echo "exit 0" >>/etc/rc.local
  254. /bin/cp /etc/skel/.bashrc ~/
  255. echo 'clear' >>.bashrc
  256. echo 'echo ""' >>.bashrc
  257. echo 'echo -e "\t\033[91m __ ______ ____ __ ____ __ " ' >>.bashrc
  258. echo 'echo -e "\t\033[91m \ \ / / _ \/ ___| | \/ \ \/ / " ' >>.bashrc
  259. echo 'echo -e "\t\033[91m \ \ / /| |_) \___ \ _____| |\/| |\ / " ' >>.bashrc
  260. echo 'echo -e "\t\033[91m \ V / | __/ ___) |_____| | | |/ \ " ' >>.bashrc
  261. echo 'echo -e "\t\033[91m \_/ |_| |____/ |_| |_/_/\_\ " ' >>.bashrc
  262. echo 'echo -e "\t\033[91m ENGLISH " ' >>.bashrc
  263. echo 'echo "" ' >>.bashrc
  264. echo 'mess1="$(less /etc/VPS-MX/message.txt)" ' >>.bashrc
  265. echo 'echo "" ' >>.bashrc
  266. echo 'echo -e "\t\033[92mRESELLER : $mess1 "' >>.bashrc
  267. echo 'echo -e "\t\e[1;33mVERSION: \e[1;31m$(cat /etc/versin_script_new)"' >>.bashrc
  268. echo 'echo "" ' >>.bashrc
  269. echo 'echo -e "\t\033[97mTO SHOW BASH PANEL WRITE: sudo VPSMX or menu "' >>.bashrc
  270. echo 'echo ""' >>.bashrc
  271. echo -e " MAIN COMMAND TO ENTER THE PANEL "
  272. echo -e " \033[1;41m sudo VPSMX o menu \033[0;37m" && msg -bar2
  273. rm -rf /usr/bin/pytransform &>/dev/null
  274. rm -rf VPS-MX.sh
  275. rm -rf lista-arq
  276. service ssh restart &>/dev/null