Advertisement
yuma2020

server.sh

Mar 6th, 2019
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.80 KB | None | 0 0
  1. #!/bin/sh
  2. # File Server.sh
  3. echo '
  4. ## Part Deploy working
  5. ##
  6. ## @author      Villalba Juan Manuel Pedro <https://github.com/juanma386>
  7. # @Version:     2.9.0
  8. # @Estado:      Beta
  9. # @Destino:     Deploy Server Php Linux
  10. # @Date:        05:41pm 26-04-2019
  11. # @EMAIL:       Hexome Desarrollos Dream team <hexomedesarrollos@gmail.com>
  12. # @Advertencia  Usar con cautela y bajo propia responsabilidad
  13. # @Licence:     GPLv2 Free Software Foundation <licensing@fsf.org>
  14. ';
  15. cd `dirname $0`/..
  16. _hoy=$(date +"%m_%d_%Y_%r_%S")
  17. _pwd=$(pwd)
  18.  
  19. SEPARADOR(){
  20. cat <<EOF
  21.  
  22.  
  23.  ################################################
  24.  ################################################
  25.  
  26.  ##         ######   ###   ##  ##    ##  ##    ##
  27.  ##         ######   ###   ##  ##    ##  :##  ##:
  28.  ##           ##     ###:  ##  ##    ##   ##  ##  
  29.  ##           ##     ####  ##  ##    ##   :####:  
  30.  ##           ##     ##:#: ##  ##    ##    ####  
  31.  ##           ##     ## ## ##  ##    ##    :##:  
  32.  ##           ##     ## ## ##  ##    ##    :##:  
  33.  ##           ##     ## :#:##  ##    ##    ####  
  34.  ##           ##     ##  ####  ##    ##   :####:  
  35.  ##           ##     ##  :###  ##    ##   ##::##  
  36.  ########   ######   ##   ###  :######:  :##  ##:
  37.  ########   ######   ##   ###   :####:   ##    ##
  38.  
  39.  ################################################
  40.  ################################################
  41.  
  42. EOF
  43. }
  44. # Integramos datos en esta version 2.09 21042019 yuma2020 Juan Manuel Pedro Villalba
  45. crear_config(){
  46. $(echo '
  47. servidor=127.0.0.1
  48. puerto=8000
  49. usuario=NOCORRESPONDE
  50. password=NOCORRESPONDE
  51. ' > ./config.ini)
  52. echo "nuevamente intentaremos ver si se ha creado el archivo"
  53. check_config
  54. }
  55. # Ahora con esto se crea un archivo para trabajar con los datos del servidor con un file llamado config.ini
  56. SEPARADOR
  57. puertos_dinamicos_iniciar(){
  58.  
  59. CFG_FILE=./config.ini
  60.  
  61. SERVER=$(awk -F "=" '/servidor/ {print $2}' "$CFG_FILE")
  62. PORT=$(awk -F "=" '/puerto/ {print $2}' "$CFG_FILE")
  63. USER=$(awk -F "=" '/usuario/ {print $2}' "$CFG_FILE")
  64. PASS=$(awk -F "=" '/password/ {print $2}' "$CFG_FILE")
  65.  
  66. echo "Che! este es tu Servidor: "$SERVER""
  67. echo "Aquí esta tu Puerto: "$PORT""
  68. echo "Estos datos son aplicables a otros medios que quieras implementar"
  69. echo "Aquí esta tu Usuario: "$USER""
  70. echo "Aquí esta tu Password: "$PASS""
  71.  
  72. }
  73. SEPARADOR
  74. puertos_dinamicos_iniciar
  75.  
  76. file=./testing.server.log
  77. if [ ! -e "$file" ]; then
  78.     echo "File does not exist"
  79.     echo "Create File inicializated Deploy"." [ "$_hoy" ]"
  80.     echo "Create File inicializated Deploy".    " [ "$_hoy" ]" > testing.server.log
  81. else
  82.     echo "Checking file is exist deployed again"." [ "$_hoy" ]"
  83.     echo "Deployed again executed OK "."  [ "$_hoy" ]" >> testing.server.log
  84. fi
  85.  
  86. ADDR_PORT=${1:-$SERVER:$PORT}
  87. DOC_ROOT="$_pwd"
  88.  
  89. php -S "$ADDR_PORT" -t "$DOC_ROOT/" -f bin/route.php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement