1
0

hora.sh 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. #!/bin/bash
  2. [[ -e /bin/ejecutar/msg ]] && source /bin/ejecutar/msg || source <(curl -sSL https://raw.githubusercontent.com/ChumoGH/ChumoGH-Script/master/msg-bar/msg)
  3. selection_fun () {
  4. local selection="null"
  5. local range
  6. for((i=0; i<=$1; i++)); do range[$i]="$i "; done
  7. while [[ ! $(echo ${range[*]}|grep -w "$selection") ]]; do
  8. echo -ne "\033[1;31m NUMERO DE OPCION : " >&2
  9. read selection
  10. tput cuu1 >&2 && tput dl1 >&2
  11. done
  12. echo $selection
  13. }
  14. act_hora () {
  15. echo "America/Chihuahua"
  16. echo "America/Chihuahua" > /etc/timezone
  17. ln -fs /usr/share/zoneinfo/America/Chihuahua /etc/localtime > /dev/null 2>&1
  18. dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  19. msg -bar
  20. return 0
  21. }
  22. act_hora1 () {
  23. echo "America/Mexico_City"
  24. echo "America/Mexico_City" > /etc/timezone
  25. ln -fs /usr/share/zoneinfo/America/Mexico_City /etc/localtime > /dev/null 2>&1
  26. dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  27. msg -bar
  28. return 0
  29. }
  30. act_hora2 () {
  31. echo "Argentina"
  32. ln -sf /usr/share/zoneinfo/America/Argentina/Buenos_Aires /etc/localtime > /dev/null 2>&1
  33. dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  34. msg -bar
  35. return 0
  36. }
  37. act_hora3 () {
  38. echo "CHILE"
  39. timedatectl > /dev/null 2>&1
  40. timedatectl list-timezones | grep Chile/Continental > /dev/null 2>&1
  41. timedatectl set-timezone Chile/Continental > /dev/null 2>&1
  42. dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  43. msg -bar
  44. return 0
  45. }
  46. act_hora4 () {
  47. echo "America/Los_Angeles"
  48. timedatectl > /dev/null 2>&1
  49. timedatectl list-timezones | grep Los_Angeles > /dev/null 2>&1
  50. timedatectl set-timezone America/Los_Angeles > /dev/null 2>&1
  51. msg -bar
  52. return 0
  53. }
  54. act_hora5 () {
  55. echo "America/La_Paz"
  56. echo "America/La_Paz" > /etc/timezone
  57. ln -fs /usr/share/zoneinfo/America/La_Paz /etc/localtime > /dev/null 2>&1
  58. dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  59. msg -bar
  60. return 0
  61. }
  62. act_hora6 () {
  63. echo "America/Guatemala"
  64. echo "America/Guatemala" > /etc/timezone
  65. ln -fs /usr/share/zoneinfo/America/Guatemala /etc/localtime > /dev/null 2>&1
  66. dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  67. msg -bar
  68. return 0
  69. }
  70. act_hora7 () {
  71. echo "America/Bogota"
  72. echo "America/Bogota" > /etc/timezone
  73. ln -fs /usr/share/zoneinfo/America/Bogota /etc/localtime > /dev/null 2>&1
  74. dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  75. msg -bar
  76. return 0
  77. }
  78. act_hora8 () {
  79. echo "America/Guayaquil"
  80. echo "America/Guayaquil" > /etc/timezone
  81. ln -fs /usr/share/zoneinfo/America/Guayaquil /etc/localtime > /dev/null 2>&1
  82. dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  83. msg -bar
  84. return 0
  85. }
  86. verzm () {
  87. timedatectl
  88. echo -e "\033[1;31m PRESIONE ENTER PARA CONTINUAR \033[0m"
  89. read -p " "
  90. return 0
  91. }
  92. shadowe_fun () {
  93. #source /etc/adm-lite/cabelcaho
  94. while true; do
  95. clear&&clear
  96. _tm=$(timedatectl | grep "Time zone")
  97. unset selection
  98. echo -e " \033[1;36m ZONA HORARIO \033[1;32m[ChumoGH-ADM]"
  99. msg -bar
  100. echo -e "${_tm}"
  101. msg -bar
  102. echo -e "${cor[4]} [1] > ${cor[2]}VER ZONA HORARIA ACTUAL ${cor[4]} [12] > ${cor[2]} HORARIO VENEZUELA"
  103. echo -e "${cor[4]} [2] > ${cor[5]}HORARIO MEXICO ${cor[4]} [13] > ${cor[2]} HORARIO BRAZIL"
  104. echo -e "${cor[4]} [3] > ${cor[5]}HORARIO Argentina"
  105. echo -e "${cor[4]} [4] > ${cor[5]}HORARIO CHILE"
  106. echo -e "${cor[4]} [5] > ${cor[5]}HORARIO MEXICO"
  107. echo -e "${cor[4]} [6] > ${cor[5]}HORARIO Bolivia "
  108. echo -e "${cor[4]} [7] > ${cor[5]}HORARIO Guatemala"
  109. echo -e "${cor[4]} [8] > ${cor[5]}HORARIO COLOMBIA"
  110. echo -e "${cor[4]} [9] > ${cor[5]}HORARIO ECUADOR "
  111. echo -e "${cor[4]} [10] > ${cor[5]}HORARIO Los Angeles (USA)"
  112. echo -e "${cor[4]} [11] > ${cor[5]}RESTAURAR ZONA ORIGINAL"
  113. echo -e "${cor[4]} [0] > ${cor[0]}SALIR"
  114. msg -bar
  115. selection=$(selection_fun 13)
  116. case ${selection} in
  117. 0)
  118. break;;
  119. 1)
  120. fun_bar
  121. verzm
  122. unset selection
  123. sleep 2s
  124. ;;
  125. 2)
  126. fun_bar
  127. act_hora1
  128. unset selection
  129. sleep 2s
  130. ;;
  131. 3)
  132. fun_bar
  133. act_hora2
  134. unset selection
  135. sleep 2s
  136. ;;
  137. 4)
  138. fun_bar
  139. act_hora3
  140. unset selection
  141. sleep 2s
  142. ;;
  143. 5)
  144. act_hora
  145. unset selection
  146. sleep 2s
  147. ;;
  148. 6)
  149. fun_bar
  150. act_hora5
  151. unset selection
  152. sleep 2s
  153. ;;
  154. 7)
  155. fun_bar
  156. act_hora6
  157. unset selection
  158. sleep 2s
  159. ;;
  160. 8)
  161. fun_bar
  162. act_hora7
  163. unset selection
  164. sleep 2s
  165. ;;
  166. 9)
  167. fun_bar
  168. act_hora8
  169. unset selection
  170. sleep 2s
  171. ;;
  172. 10)
  173. fun_bar
  174. act_hora4
  175. unset selection
  176. sleep 2s
  177. ;;
  178. 11)
  179. fun_bar
  180. echo "Etc/UTC" > /etc/timezone
  181. ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
  182. dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  183. sleep 2s
  184. ;;
  185. 12)
  186. fun_bar
  187. echo "America/Caracas" > /etc/timezone
  188. ln -fs /usr/share/zoneinfo/America/Caracas /etc/localtime
  189. dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  190. sleep 2s
  191. ;;
  192. 13)
  193. fun_bar
  194. echo "America/Sao_Paulo" > /etc/timezone
  195. ln -fs /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
  196. dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  197. sleep 2s
  198. ;;
  199. 14)
  200. fun_bar
  201. echo "America/Caracas" > /etc/timezone
  202. ln -fs /usr/share/zoneinfo/America/Caracas /etc/localtime
  203. dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  204. sleep 2s
  205. ;;
  206. 15)
  207. fun_bar
  208. echo "America/Caracas" > /etc/timezone
  209. ln -fs /usr/share/zoneinfo/America/Caracas /etc/localtime
  210. dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  211. sleep 2s
  212. ;;
  213. 16)
  214. fun_bar
  215. echo "America/Caracas" > /etc/timezone
  216. ln -fs /usr/share/zoneinfo/America/Caracas /etc/localtime
  217. dpkg-reconfigure --frontend noninteractive tzdata > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
  218. sleep 2s
  219. ;;
  220. 17)
  221. fun_bar
  222. echo "America/Caracas" > /etc/timezone
  223. ln -fs /usr/share/zoneinfo/America/Caracas /etc/localtime
  224. sleep 2s
  225. ;;
  226. 18)
  227. fun_bar
  228. echo "America/Caracas" > /etc/timezone
  229. ln -fs /usr/share/zoneinfo/America/Caracas /etc/localtime
  230. ;;
  231. 19)
  232. fun_bar
  233. echo "America/Caracas" > /etc/timezone
  234. ln -fs /usr/share/zoneinfo/America/Caracas /etc/localtime
  235. ;;
  236. 20)
  237. fun_bar
  238. echo "America/Caracas" > /etc/timezone
  239. ln -fs /usr/share/zoneinfo/America/Caracas /etc/localtime
  240. ;;
  241. esac
  242. done
  243. }
  244. shadowe_fun