restart.sh 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. #!/bin/bash
  2. echo -e ""
  3. echo -e "======================================"
  4. echo -e ""
  5. echo -e ""
  6. echo -e " [1] Restart All Services"
  7. echo -e " [2] Restart OpenSSH"
  8. echo -e " [3] Restart Dropbear"
  9. echo -e " [4] Restart Stunnel4"
  10. echo -e " [5] Restart OpenVPN"
  11. echo -e " [6] Restart Squid"
  12. echo -e " [7] Restart Nginx"
  13. echo -e " [8] Restart Badvpn"
  14. echo -e " [x] Exit"
  15. echo -e ""
  16. read -p " Select From Options [1-8 or x] : " Restart
  17. echo -e ""
  18. echo -e "======================================"
  19. sleep 1
  20. clear
  21. case $Restart in
  22. 1)
  23. clear
  24. /etc/init.d/ssh restart
  25. /etc/init.d/dropbear restart
  26. /etc/init.d/stunnel4 restart
  27. /etc/init.d/openvpn restart
  28. /etc/init.d/fail2ban restart
  29. /etc/init.d/cron restart
  30. /etc/init.d/nginx restart
  31. /etc/init.d/squid restart
  32. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7100 --max-clients 1000
  33. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7200 --max-clients 1000
  34. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 1000
  35. echo -e ""
  36. echo -e "======================================"
  37. echo -e ""
  38. echo -e " Service/s Restarted "
  39. echo -e ""
  40. echo -e "======================================"
  41. exit
  42. ;;
  43. 2)
  44. clear
  45. /etc/init.d/ssh restart
  46. echo -e ""
  47. echo -e "======================================"
  48. echo -e ""
  49. echo -e " SSH Service Restarted "
  50. echo -e ""
  51. echo -e "======================================"
  52. exit
  53. ;;
  54. 3)
  55. clear
  56. /etc/init.d/dropbear restart
  57. echo -e ""
  58. echo -e "======================================"
  59. echo -e ""
  60. echo -e " Dropbear Service Restarted "
  61. echo -e ""
  62. echo -e "======================================"
  63. exit
  64. ;;
  65. 4)
  66. clear
  67. /etc/init.d/stunnel4 restart
  68. echo -e ""
  69. echo -e "======================================"
  70. echo -e ""
  71. echo -e " Stunnel4 Service Restarted "
  72. echo -e ""
  73. echo -e "======================================"
  74. exit
  75. ;;
  76. 5)
  77. clear
  78. /etc/init.d/openvpn restart
  79. echo -e ""
  80. echo -e "======================================"
  81. echo -e ""
  82. echo -e " OpenVPN Service Restarted "
  83. echo -e ""
  84. echo -e "======================================"
  85. exit
  86. ;;
  87. 6)
  88. clear
  89. /etc/init.d/squid restart
  90. echo -e ""
  91. echo -e "======================================"
  92. echo -e ""
  93. echo -e " Squid3 Service Restarted "
  94. echo -e ""
  95. echo -e "======================================"
  96. exit
  97. ;;
  98. 7)
  99. clear
  100. /etc/init.d/nginx restart
  101. echo -e ""
  102. echo -e "======================================"
  103. echo -e ""
  104. echo -e " Nginx Service Restarted "
  105. echo -e ""
  106. echo -e "======================================"
  107. exit
  108. ;;
  109. 8)
  110. clear
  111. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7100 --max-clients 500
  112. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7200 --max-clients 500
  113. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 500
  114. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7400 --max-clients 500
  115. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7500 --max-clients 500
  116. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7600 --max-clients 500
  117. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7700 --max-clients 500
  118. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7800 --max-clients 500
  119. screen -dmS badvpn badvpn-udpgw --listen-addr 127.0.0.1:7900 --max-clients 500
  120. echo -e ""
  121. echo -e "======================================"
  122. echo -e ""
  123. echo -e " Badvpn Badvpn Service Restarted "
  124. echo -e ""
  125. echo -e "======================================"
  126. exit
  127. ;;
  128. x)
  129. clear
  130. exit
  131. ;;
  132. esac