running.sh 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. #!/bin/bash
  2. # IP Validation
  3. MYIP=$(wget -qO- icanhazip.com);
  4. # VPS Information
  5. Checkstart1=$(ip route | grep default | cut -d ' ' -f 3 | head -n 1);
  6. if [[ $Checkstart1 == "venet0" ]]; then
  7. clear
  8. lan_net="venet0"
  9. typevps="OpenVZ"
  10. sleep 1
  11. else
  12. clear
  13. lan_net="eth0"
  14. typevps="KVM"
  15. sleep 1
  16. fi
  17. # Getting OS Information
  18. source /etc/os-release
  19. Versi_OS=$VERSION
  20. ver=$VERSION_ID
  21. Tipe=$NAME
  22. URL_SUPPORT=$HOME_URL
  23. basedong=$ID
  24. # VPS ISP INFORMATION
  25. ITAM='\033[0;30m'
  26. echo -e "$ITAM"
  27. NAMAISP=$( curl -s ipinfo.io/org | cut -d " " -f 2-10 )
  28. REGION=$( curl -s ipinfo.io/region )
  29. #clear
  30. COUNTRY=$( curl -s ipinfo.io/country )
  31. #clear
  32. WAKTU=$( curl -s ipinfo.ip/timezone )
  33. #clear
  34. CITY=$( curl -s ipinfo.io/city )
  35. #clear
  36. REGION=$( curl -s ipinfo.io/region )
  37. #clear
  38. WAKTUE=$( curl -s ipinfo.io/timezone )
  39. #clear
  40. koordinat=$( curl -s ipinfo.io/loc )
  41. #clear
  42. NC='\033[0m'
  43. echo -e "$NC"
  44. # Chek Status
  45. l2tp_status=$(systemctl status xl2tpd | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  46. openvpn_service="$(systemctl show openvpn.service --no-page)"
  47. oovpn=$(echo "${openvpn_service}" | grep 'ActiveState=' | cut -f2 -d=)
  48. #status_openvp=$(/etc/init.d/openvpn status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  49. #status_ss_tls="$(systemctl show shadowsocks-libev-server@tls.service --no-page)"
  50. #ss_tls=$(echo "${status_ss_tls}" | grep 'ActiveState=' | cut -f2 -d=)
  51. #sssotl=$(systemctl status shadowsocks-libev-server@*-tls | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  52. #status_ss_http="$(systemctl show shadowsocks-libev-server@http.service --no-page)"
  53. #ss_http=$(echo "${status_ss_http}" | grep 'ActiveState=' | cut -f2 -d=)
  54. #sssohtt=$(systemctl status shadowsocks-libev-server@*-http | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  55. status="$(systemctl show shadowsocks-libev.service --no-page)"
  56. status_text=$(echo "${status}" | grep 'ActiveState=' | cut -f2 -d=)
  57. tls_v2ray_status=$(systemctl status v2ray | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  58. nontls_v2ray_status=$(systemctl status v2ray@none | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  59. vless_tls_v2ray_status=$(systemctl status v2ray@vless | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  60. vless_nontls_v2ray_status=$(systemctl status v2ray@vnone | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  61. ssr_status=$(systemctl status ssrmu | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  62. trojan_server=$(systemctl status trojan | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  63. dropbear_status=$(/etc/init.d/dropbear status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  64. stunnel_service=$(/etc/init.d/stunnel4 status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  65. sstp_service=$(systemctl status accel-ppp | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  66. squid_service=$(/etc/init.d/squid status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  67. ssh_service=$(/etc/init.d/ssh status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  68. vnstat_service=$(/etc/init.d/vnstat status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  69. cron_service=$(/etc/init.d/cron status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  70. fail2ban_service=$(/etc/init.d/fail2ban status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  71. wg="$(systemctl show wg-quick@wg0.service --no-page)"
  72. swg=$(echo "${wg}" | grep 'ActiveState=' | cut -f2 -d=)
  73. sswg=$(systemctl status wg-quick@wg0 | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
  74. # Color Validation
  75. RED='\033[0;31m'
  76. NC='\033[0m'
  77. GREEN='\033[0;32m'
  78. ORANGE='\033[0;33m'
  79. BLUE='\033[0;34m'
  80. PURPLE='\033[0;35m'
  81. CYAN='\033[0;36m'
  82. LIGHT='\033[0;37m'
  83. clear
  84. # Status Service OpenVPN
  85. if [[ $oovpn == "active" ]]; then
  86. status_openvpn="${GREEN}OpenVPN Service Is Running ${NC}( Aktif )"
  87. else
  88. status_openvpn="${RED}OpenVPN Service Is Not Running ${NC}( Not Aktif )"
  89. fi
  90. # Status Service SSH
  91. if [[ $ssh_service == "running" ]]; then
  92. status_ssh="${GREEN}SSH/Tunnel Service Is Running ${NC}( Aktif )"
  93. else
  94. status_ssh="${RED}SSH/Tunnel Service Is Not Running ${NC}( Not Aktif )"
  95. fi
  96. # Status Service Squid
  97. if [[ $squid_service == "running" ]]; then
  98. status_squid="${GREEN}Squid Service Is Running ${NC}( Aktif )"
  99. else
  100. status_squid="${RED}Squid Service Is Not Running ${NC}( Not Aktif )"
  101. fi
  102. # Status Service VNSTAT
  103. if [[ $vnstat_service == "running" ]]; then
  104. status_vnstat="${GREEN}Vnstat Service Is Running ${NC}( Aktif )"
  105. else
  106. status_vnstat="${RED}Vnstat Service Is Not Running ${NC}( Not Aktif )"
  107. fi
  108. # Status Service Crons
  109. if [[ $cron_service == "running" ]]; then
  110. status_cron="${GREEN}Crons Service Is Running ${NC}( Aktif )"
  111. else
  112. status_cron="${RED}Crons Service Is Not Running ${NC}( Not Aktif )"
  113. fi
  114. # Status Service Fail2ban
  115. if [[ $fail2ban_service == "running" ]]; then
  116. status_fail2ban="${GREEN}Fail2Ban Service Is Running ${NC}( Aktif )"
  117. else
  118. status_fail2ban="${RED}Fail2Ban Service Is Not Running ${NC}( Not Aktif )"
  119. fi
  120. # Status Service TLS
  121. if [[ $tls_v2ray_status == "running" ]]; then
  122. status_tls_v2ray="${GREEN}V2Ray HTTPS Service Is Running${NC} ( Aktif )"
  123. else
  124. status_tls_v2ray="${RED}V2Ray HTTPS Service Is Not Running${NC} ( Not Aktif )"
  125. fi
  126. # Status Service Non TLS V2Ray
  127. if [[ $nontls_v2ray_status == "running" ]]; then
  128. status_nontls_v2ray="${GREEN}V2Ray HTTP Service Is Running ${NC}( Aktif )${NC}"
  129. else
  130. status_nontls_v2ray="${RED}V2Ray HTTP Service Is Not Running ${NC}( Not Aktif )${NC}"
  131. fi
  132. # Status Service Vless HTTPS
  133. if [[ $vless_tls_v2ray_status == "running" ]]; then
  134. status_tls_vless="${GREEN}Vless HTTPS Service Is Running${NC} ( Aktif )"
  135. else
  136. status_tls_vless="${RED}Vless HTTPS Service Is Not Running ${NC}( Not Aktif )${NC}"
  137. fi
  138. # Status Service Vless HTTP
  139. if [[ $vless_nontls_v2ray_status == "running" ]]; then
  140. status_nontls_vless="${GREEN}Vless HTTP Service Is Running${NC} ( Aktif )"
  141. else
  142. status_nontls_vless="${RED}Vless HTTP Service Is Not Running ${NC}( Not Aktif )${NC}"
  143. fi
  144. # ShadowsocksR Status
  145. if [[ $ssr_status == "running" ]] ; then
  146. status_ssr="${GREEN}SSR Service Is Running${NC} ( Aktif )${NC}"
  147. else
  148. status_ssr="${RED}SSR Service Is Not Running ${NC}( Not Aktif )${NC}"
  149. fi
  150. # Sodosok
  151. if [[ $status_text == "active" ]] ; then
  152. status_sodosok="${GREEN}Shadowsock Service Is Running${NC} ( Aktif )${NC}"
  153. else
  154. status_sodosok="${RED}Shadowsocks Service Is Not Running ${NC}( Not Aktif )${NC}"
  155. fi
  156. # Status Service Trojan
  157. if [[ $trojan_server == "running" ]]; then
  158. status_virus_trojan="${GREEN}Trojan Service Is Running ${NC}( Aktif )${NC}"
  159. else
  160. status_virus_trojan="${RED}Trojan Service Is Not Running ${NC}( Not Aktif )${NC}"
  161. fi
  162. # Status Service Wireguard
  163. if [[ $swg == "active" ]]; then
  164. status_wg="${GREEN}Wireguard Service Is Running ${NC}( Aktif )${NC}"
  165. else
  166. status_wg="${RED}Wireguard Service Is Not Running ${NC}( Not Aktif )${NC}"
  167. fi
  168. # Status Service L2TP
  169. if [[ $l2tp_status == "running" ]]; then
  170. status_l2tp="${GREEN}L2TP Service Is Running${NC} ( Aktif )${NC}"
  171. else
  172. status_l2tp="${RED}L2TP Service Is Not Running${NC}( Not Aktif )${NC}"
  173. fi
  174. # Status Service Dropbear
  175. if [[ $dropbear_status == "running" ]]; then
  176. status_beruangjatuh="${GREEN}Dropbear Service Is Running${NC} ( Aktif )${NC}"
  177. else
  178. status_beruangjatuh="${RED}Dropbear Service Is Not Running ${NC}( Not Aktif )${NC}"
  179. fi
  180. # Status Service Stunnel
  181. if [[ $stunnel_service == "running" ]]; then
  182. status_stunnel="${GREEN}Stunnel Service Is Running ${NC}( Aktif )"
  183. else
  184. status_stunnel="${RED}Stunnel Service Is Not Running ${NC}( Not Aktif )}"
  185. fi
  186. # Status Service SSTP
  187. if [[ $sstp_service == "running" ]]; then
  188. status_sstp="${GREEN}SSTP Service Is Running ${NC}( Aktif )"
  189. else
  190. status_sstp="${RED}SSTP Service Is Not Running ${NC}( Not Aktif )"
  191. fi
  192. # Ram Usage
  193. total_r2am=` grep "MemAvailable: " /proc/meminfo | awk '{ print $2}'`
  194. MEMORY=$(($total_r2am/1024))
  195. # Download
  196. download=`grep -e "lo:" -e "wlan0:" -e "eth0" /proc/net/dev | awk '{print $2}' | paste -sd+ - | bc`
  197. downloadsize=$(($download/1073741824))
  198. # Upload
  199. upload=`grep -e "lo:" -e "wlan0:" -e "eth0" /proc/net/dev | awk '{print $10}' | paste -sd+ - | bc`
  200. uploadsize=$(($upload/1073741824))
  201. # Total Ram
  202. total_ram=` grep "MemTotal: " /proc/meminfo | awk '{ print $2}'`
  203. totalram=$(($total_ram/1024))
  204. # Tipe Processor
  205. totalcore="$(grep -c "^processor" /proc/cpuinfo)"
  206. totalcore+=" Core"
  207. corediilik="$(grep -c "^processor" /proc/cpuinfo)"
  208. tipeprosesor="$(awk -F ': | @' '/model name|Processor|^cpu model|chip type|^cpu type/ {
  209. printf $2;
  210. exit
  211. }' /proc/cpuinfo)"
  212. # Shell Version
  213. shellversion=""
  214. shellversion=Bash
  215. shellversion+=" Version"
  216. shellversion+=" ${BASH_VERSION/-*}"
  217. versibash=$shellversion
  218. # Getting CPU Information
  219. cpu_usage1="$(ps aux | awk 'BEGIN {sum=0} {sum+=$3}; END {print sum}')"
  220. cpu_usage="$((${cpu_usage1/\.*} / ${corediilik:-1}))"
  221. cpu_usage+=" %"
  222. # OS Uptime
  223. uptime="$(uptime -p | cut -d " " -f 2-10)"
  224. # Kernel Terbaru
  225. kernelku=$(uname -r)
  226. # Waktu Sekarang
  227. harini=`date -d "0 days" +"%d-%m-%Y"`
  228. jam=`date -d "0 days" +"%X"`
  229. # DNS Patch
  230. tipeos2=$(uname -m)
  231. # Getting Domain Name
  232. Domen="$(cat /etc/v2ray/domain)"
  233. # Echoing Result
  234. echo -e ""
  235. echo -e "In Here Is Your VPS Information : " | lolcat
  236. echo "-------------------------------------------------------------------------------" | lolcat
  237. echo "Operating System Information :" | lolcat
  238. echo -e "VPS Type : $typevps"
  239. echo -e "OS Arch : $tipeos2"
  240. echo -e "Hostname : $HOSTNAME"
  241. echo -e "OS Name : $Tipe"
  242. echo -e "OS Version : $Versi_OS"
  243. echo -e "OS URL : $URL_SUPPORT"
  244. echo -e "OS BASE : $basedong"
  245. echo -e "OS TYPE : Linux / Unix"
  246. echo -e "Bash Ver : $versibash"
  247. echo -e "Kernel Ver : $kernelku"
  248. echo "-------------------------------------------------------------------------------" | lolcat
  249. echo "Hardware Information :" | lolcat
  250. echo -e "Processor : $tipeprosesor"
  251. echo -e "Proc Core : $totalcore"
  252. echo -e "Virtual : $typevps"
  253. echo -e "Cpu Usage : $cpu_usage"
  254. echo "-------------------------------------------------------------------------------" | lolcat
  255. echo "System Status / System Information :" | lolcat
  256. echo -e "Uptime : $uptime ( From VPS Booting )"
  257. echo -e "Total RAM : ${totalram}MB"
  258. echo -e "Avaible : ${MEMORY}MB"
  259. echo -e "Download : $downloadsize GB ( From Startup / VPS Booting )"
  260. echo -e "Upload : $uploadsize GB ( From Startup / VPS Booting )"
  261. echo "-------------------------------------------------------------------------------" | lolcat
  262. echo "Internet Service Provider Information :" | lolcat
  263. echo -e "Public IP : $MYIP"
  264. echo -e "Domain : $Domen"
  265. echo -e "ISP Name : $NAMAISP"
  266. echo -e "Region : $REGION "
  267. echo -e "Country : $COUNTRY"
  268. echo -e "City : $CITY "
  269. echo -e "Time Zone : $WAKTUE"
  270. echo "-------------------------------------------------------------------------------" | lolcat
  271. echo "Time & Date & Location & Coordinate Information :" | lolcat
  272. echo -e "Location : $COUNTRY"
  273. echo -e "Coordinate : $koordinat"
  274. echo -e "Time Zone : $WAKTUE"
  275. echo -e "Date : $harini"
  276. echo -e "Time : $jam ( WIB )"
  277. echo "-------------------------------------------------------------------------------" | lolcat
  278. echo "System Status Information :" | lolcat
  279. echo -e "SSH / Tun : $status_ssh"
  280. echo -e "OpenVPN : $status_openvpn"
  281. echo -e "Dropbear : $status_beruangjatuh"
  282. echo -e "Stunnel : $status_stunnel"
  283. echo -e "Squid : $status_squid"
  284. echo -e "Fail2Ban : $status_fail2ban"
  285. echo -e "Crons : $status_cron"
  286. echo -e "Vnstat : $status_vnstat"
  287. echo -e "L2TP : $status_l2tp"
  288. echo -e "SSTP : $status_sstp"
  289. echo -e "V2Ray TLS : $status_tls_v2ray"
  290. echo -e "V2Ray HTTP : $status_nontls_v2ray"
  291. echo -e "Vless TLS : $status_tls_vless"
  292. echo -e "Vless HTTP : $status_nontls_vless"
  293. echo -e "SSR : $status_ssr"
  294. echo -e "Shadowsocks : $status_sodosok"
  295. echo -e "Trojan : $status_virus_trojan"
  296. echo -e "Wireguard : $status_wg"
  297. echo "------------------------------------------------------------------------" | lolcat
  298. echo ""