Advertisement
Guest User

runsh2

a guest
Dec 11th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.14 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. if [ `id -u` = "root" ]; then
  4. echo "This script must not be run as root" 1>&2
  5. exit 1
  6. fi
  7.  
  8. ROOT=$PWD
  9.  
  10. cd $ROOT && sh clear.sh
  11.  
  12. chmod u=rwx,g=r,o=r $ROOT/share/bin/game
  13. chmod u=rwx,g=r,o=r $ROOT/share/bin/db
  14. chmod u=rwx,g=r,o=r $ROOT/share/bin/vrunner
  15. chmod u=rwx,g=r,o=r $ROOT/share/bin/CMD
  16.  
  17. find . -type d -exec chmod u=rwx,g=rx,o=rx {} \;
  18. find . -name "*.sh" -exec chmod u=rwx,g=r,o=r {} \;
  19.  
  20. # core1 launch the database loop
  21. clear
  22. echo -e "\033[32mVrei să deschizi un nou canal? (Maxim: 4)\033[0m"
  23. read chs
  24. case $chs in
  25. 1*)
  26. clear
  27. echo -e "\033[32m-- Serverul pornește --\033[0m"
  28.  
  29. # Then the db server loop
  30. echo -e "Bază de date pornită"
  31. cd $ROOT/core/db && ./db
  32. sleep 2
  33.  
  34. # Then the auth server loop
  35. echo -e "Server de login pornit"
  36. cd $ROOT/core/auth && ./game
  37. sleep 2
  38.  
  39. # Then the ch1 server loop
  40. echo "Ch1 pornit"
  41. cd $ROOT/core/ch1/core2 && ./game
  42. sleep 1
  43. cd $ROOT/core/ch1/core3 && ./game
  44. sleep 1
  45. cd $ROOT/core/ch1/core1 && ./game
  46. sleep 2
  47.  
  48. # Then the game99 server loop
  49. echo -e "Game99 pornit"
  50. cd $ROOT/core/game99 && ./game
  51. sleep 2
  52.  
  53. echo -e "\033[32m-- Server pornit --\033[0m"
  54. ;;
  55. 2*)
  56. clear
  57. echo -e "\033[32m-- Joc pornit --\033[0m"
  58.  
  59. # Then the db server loop
  60. echo "Bază de date pornită"
  61. cd $ROOT/core/db && sh run.sh
  62. sleep 2
  63.  
  64. # Then the auth server loop
  65. echo "Server de login pornit"
  66. cd $ROOT/core/auth && sh run.sh
  67. sleep 2
  68.  
  69. # Then the ch1 server loop
  70. echo "Ch1 pornit"
  71. cd $ROOT/core/ch1/core2 && sh run.sh
  72. sleep 1
  73. cd $ROOT/core/ch1/core3 && sh run.sh
  74. sleep 1
  75. cd $ROOT/core/ch1/core1 && sh run.sh
  76. sleep 2
  77.  
  78. # Then the ch2 server loop
  79. echo "Ch2 pornit"
  80. cd $ROOT/core/ch2/core2 && sh run.sh
  81. sleep 1
  82. cd $ROOT/core/ch2/core3 && sh run.sh
  83. sleep 1
  84. cd $ROOT/core/ch2/core1 && sh run.sh
  85. sleep 2
  86.  
  87. # Then the game99 server loop
  88. echo "Game99 pornit"
  89. cd $ROOT/core/game99 && sh run.sh
  90. sleep 2
  91.  
  92. echo -e "\033[32m-- Server pornit --\033[0m"
  93. ;;
  94. 3*)
  95. clear
  96. echo -e "\033[32m-- Joc pornit --\033[0m"
  97.  
  98. # Then the db server loop
  99. echo "Bază de date pornită"
  100. cd $ROOT/core/db && sh run.sh
  101. sleep 2
  102.  
  103. # Then the auth server loop
  104. echo "Server de login pornit"
  105. cd $ROOT/core/auth && sh run.sh
  106. sleep 2
  107.  
  108. # Then the ch1 server loop
  109. echo "Ch1 pornit"
  110. cd $ROOT/core/ch1/core2 && sh run.sh
  111. sleep 1
  112. cd $ROOT/core/ch1/core3 && sh run.sh
  113. sleep 1
  114. cd $ROOT/core/ch1/core1 && sh run.sh
  115. sleep 2
  116.  
  117. # Then the ch2 server loop
  118. echo "Ch2 pornit"
  119. cd $ROOT/core/ch2/core2 && sh run.sh
  120. sleep 1
  121. cd $ROOT/core/ch2/core3 && sh run.sh
  122. sleep 1
  123. cd $ROOT/core/ch2/core1 && sh run.sh
  124. sleep 2
  125.  
  126. # Then the ch3 server loop
  127. echo "Ch3 pornit"
  128. cd $ROOT/core/ch3/core2 && sh run.sh
  129. sleep 1
  130. cd $ROOT/core/ch3/core3 && sh run.sh
  131. sleep 1
  132. cd $ROOT/core/ch3/core1 && sh run.sh
  133. sleep 2
  134.  
  135. # Then the game99 server loop
  136. echo "Game99 pornit"
  137. cd $ROOT/core/game99 && sh run.sh
  138. sleep 2
  139.  
  140. echo -e "\033[32m-- Server pornit --\033[0m"
  141. ;;
  142. 4*)
  143. clear
  144. echo -e "\033[32m-- Joc pornit --\033[0m"
  145.  
  146. # Then the db server loop
  147. echo "Bază de date pornită"
  148. cd $ROOT/core/db && sh run.sh
  149. sleep 2
  150.  
  151. # Then the auth server loop
  152. echo "Server de login pornit"
  153. cd $ROOT/core/auth && sh run.sh
  154. sleep 2
  155.  
  156. # Then the ch1 server loop
  157. echo "Ch1 pornit"
  158. cd $ROOT/core/ch1/core2 && sh run.sh
  159. sleep 1
  160. cd $ROOT/core/ch1/core3 && sh run.sh
  161. sleep 1
  162. cd $ROOT/core/ch1/core1 && sh run.sh
  163. sleep 2
  164.  
  165. # Then the ch2 server loop
  166. echo "Ch2 pornit"
  167. cd $ROOT/core/ch2/core2 && sh run.sh
  168. sleep 1
  169. cd $ROOT/core/ch2/core3 && sh run.sh
  170. sleep 1
  171. cd $ROOT/core/ch2/core1 && sh run.sh
  172. sleep 2
  173.  
  174. # Then the ch3 server loop
  175. echo "Ch3 pornit"
  176. cd $ROOT/core/ch3/core2 && sh run.sh
  177. sleep 1
  178. cd $ROOT/core/ch3/core3 && sh run.sh
  179. sleep 1
  180. cd $ROOT/core/ch3/core1 && sh run.sh
  181. sleep 2
  182.  
  183. # Then the ch4 server loop
  184. echo "Ch4 pornit"
  185. cd $ROOT/core/ch4/core2 && sh run.sh
  186. sleep 1
  187. cd $ROOT/core/ch4/core3 && sh run.sh
  188. sleep 1
  189. cd $ROOT/core/ch4/core1 && sh run.sh
  190. sleep 2
  191.  
  192. # Then the game99 server loop
  193. echo "Game99 pornit"
  194. cd $ROOT/core/game99 && sh run.sh
  195. sleep 2
  196.  
  197. echo -e "\033[32m-- Server pornit --\033[0m"
  198. ;;
  199. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement