ohp-db.sh 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/bin/bash
  2. # Program: OHPServer ohp-dropbear
  3. export DEBIAN_FRONTEND=noninteractive
  4. MYIP=$(wget -qO- icanhazip.com);
  5. MYIP2="s/xxxxxxxxx/$MYIP/g";
  6. NET=$(ip -o $ANU -4 route show to default | awk '{print $5}');
  7. source /etc/os-release
  8. ver=$VERSION_ID
  9. # installing ohpserver
  10. if [[ -e /usr/bin/ohpserver ]]; then
  11. echo -e "ohpserver already install"
  12. sleep 3;clear
  13. else
  14. echo -e "installing ohpserver"
  15. sleep 3;clear
  16. wget https://github.com/lfasmpao/open-http-puncher/releases/download/0.1/ohpserver-linux32.zip
  17. unzip ohpserver-linux32.zip
  18. rm *.zip
  19. mv ohpserver /usr/bin/
  20. chmod +x /usr/bin/ohpserver
  21. fi
  22. # adding ohp-dropbear for ohpserver
  23. if [[ -e /usr/bin/ohp-dropbear ]]; then
  24. echo -e "ohp-dropbear for ohpserver exist but will be update"
  25. sleep 3;clear
  26. rm /usr/bin/ohp-dropbear
  27. cat> /usr/bin/ohp-dropbear << END
  28. #!/bin/bash
  29. screen -dmS dropbear ohpserver -port 50001 -proxy $MYIP:80443 -tunnel $MYIP:143
  30. screen -dmS openvpn ohpserver -port 50000 -proxy $MYIP:80443 -tunnel $MYIP:1194
  31. #screen -dmS vless ohpserver -port 8058 -proxy $MYIP:80443 -tunnel $MYIP:880
  32. END
  33. chmod +x /usr/bin/ohp-dropbear
  34. else
  35. echo -e "adding ohp-dropbear for ohpserver"
  36. sleep 3;clear
  37. cat> /usr/bin/ohp-dropbear << END
  38. #!/bin/bash
  39. screen -dmS dropbear ohpserver -port 50001 -proxy $MYIP:80443 -tunnel $MYIP:143
  40. screen -dmS openvpn ohpserver -port 50000 -proxy $MYIP:80443 -tunnel $MYIP:1194
  41. #screen -dmS vless ohpserver -port 8058 -proxy $MYIP:80443 -tunnel $MYIP:880
  42. END
  43. chmod +x /usr/bin/ohp-dropbear
  44. fi
  45. # adding ohp-dropbear service for running
  46. if [[ -e /etc/systemd/system/ohp-dropbear.service ]]; then
  47. echo -e "ohp-dropbear service already adding"
  48. sleep 3;clear
  49. else
  50. echo -e "adding ohp-dropbear service for running"
  51. sleep 3;clear
  52. cat> /etc/systemd/system/ohp-dropbear.service << END
  53. [Unit]
  54. Description=OHP ohp-dropbear
  55. [Service]
  56. Type=forking
  57. ExecStart=/usr/bin/ohp-dropbear
  58. [Install]
  59. WantedBy=multi-user.target
  60. END
  61. systemctl daemon-reload
  62. service ohp-dropbear start
  63. systemctl enable ohp-dropbear
  64. fi
  65. if [[ -e /root/log-ohp.txt ]]; then
  66. rm /root/log-ohp.txt
  67. echo -e "Installation has been completed!!"
  68. echo ""
  69. echo ""
  70. echo "DROPBEAR : 8170" | tee -a log-ohp.txt
  71. echo "Openvpn Non : 50000" | tee -a log-ohp.txt
  72. echo ""
  73. echo ""
  74. read -n 1 -r -s -p $'Press any key to reboot...\n';reboot
  75. else
  76. echo -e "Installation has been completed!!"
  77. echo ""
  78. echo ""
  79. echo "DROPBEAR : 50001" | tee -a log-ohp.txt
  80. echo "OPENVPN : 50000" | tee -a log-ohp.txt
  81. echo ""
  82. fi