-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can u make the bash scripts for Debien/Ubuntu? #3
Comments
here you are,it work for CentOS 7, Debian8/9, Ubuntu14.04+ #!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================================#
# System Required: CentOS 7, Debian8/9, Ubuntu14.04+ #
# Description: One click Install PUBG-Radar #
# Author: AlphaBrock <[email protected]> #
# Thanks: @794959818 <https://github.com/794959818/pubgradar> #
#=================================================================#
clear
echo "#######################################################################"
echo "# #"
echo "# One click Install PUBG-Radar #"
echo "# Intro: https://github.com/794959818/pubgradar #"
echo "# Author: AlphaBrock <[email protected]> #"
echo "# Thanks: @794959818 <https://github.com/794959818/pubgradar> #"
echo "# #"
echo "#######################################################################"
echo
echo "Press any key to continue"
#Current folder
cur_dir=`pwd`
# Color
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
plain='\033[0m'
# Make sure only root can run our script
[[ $EUID -ne 0 ]] && echo -e "[${red}Error:${plain}] 必须以ROOT权限运行!" && exit 1
# Disable selinux
disable_selinux(){
if [ -s /etc/selinux/config ] && grep 'SELINUX=enforcing' /etc/selinux/config; then
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
fi
}
#Check system
check_sys(){
local checkType=$1
local value=$2
local release=''
local systemPackage=''
if [[ -f /etc/redhat-release ]]; then
release="centos"
systemPackage="yum"
elif cat /etc/issue | grep -Eqi "debian"; then
release="debian"
systemPackage="apt"
elif cat /etc/issue | grep -Eqi "ubuntu"; then
release="ubuntu"
systemPackage="apt"
elif cat /etc/issue | grep -Eqi "centos|red hat|redhat"; then
release="centos"
systemPackage="yum"
elif cat /proc/version | grep -Eqi "debian"; then
release="debian"
systemPackage="apt"
elif cat /proc/version | grep -Eqi "ubuntu"; then
release="ubuntu"
systemPackage="apt"
elif cat /proc/version | grep -Eqi "centos|red hat|redhat"; then
release="centos"
systemPackage="yum"
fi
if [[ ${checkType} == "sysRelease" ]]; then
if [ "$value" == "$release" ]; then
return 0
else
return 1
fi
elif [[ ${checkType} == "packageManager" ]]; then
if [ "$value" == "$systemPackage" ]; then
return 0
else
return 1
fi
fi
}
# Get version
getversion(){
if [[ -s /etc/redhat-release ]]; then
grep -oE "[0-9.]+" /etc/redhat-release
else
grep -oE "[0-9.]+" /etc/issue
fi
}
# CentOS version
centosversion(){
if check_sys sysRelease centos; then
local code=$1
local version="$(getversion)"
local main_ver=${version%%.*}
if [ "$main_ver" == "$code" ]; then
return 0
else
return 1
fi
else
return 1
fi
}
get_char(){
SAVEDSTTY=`stty -g`
stty -echo
stty cbreak
dd if=/dev/tty bs=1 count=1 2> /dev/null
stty -raw
stty echo
stty $SAVEDSTTY
}
install_shadowsocksr(){
echo -e "${green}是否需要安装ss/ssr?${plain}[y/N]" && echo
stty erase '^H' && read -p "(默认: n):" unyn
[[ -z ${unyn} ]] && echo && echo -e "${green}已取消...${plain}"
if [[ ${unyn} == [Yy] ]]; then
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR.sh
chmod +x shadowsocksR.sh
./shadowsocksR.sh 2>&1 | tee shadowsocksR.log
echo && echo -e "${green}ss/ssr安装完成 !${plain}" && echo
read -p "回车后安装吃鸡雷达:"
fi
}
# Pre-installation settings
pre_install(){
if check_sys packageManager yum || check_sys packageManager apt; then
# Not support CentOS 5
if centosversion 5 || centosversion 6; then
echo -e "$[{red}Error:${plain}] 脚本不支持 CentOS 5,请更换到 CentOS 7/Debian 8+/Ubuntu 14+ 再试一次."
exit 1
fi
else
echo -e "[${red}Error:${plain}] 你的系统不被脚本支持. 请更换到 CentOS/Debian/Ubuntu 再试一次."
exit 1
fi
# Install necessary dependencies
if check_sys packageManager yum; then
yum -y update
yum -y groupinstall 'Development Tools'
yum install -y curl flex bison git net-tools
yum install -y libpcap-devel
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
yum install -y nodejs
elif check_sys packageManager apt; then
apt-get -y update
apt-get -y install build-essential
apt-get -y install libpcap-dev flex bison git sudo curl
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
apt-get install -y nodejs
fi
cd ${cur_dir}
}
# Firewall set
firewall_set(){
echo -e "[${green}Info${plain}] firewall 开始设置..."
if centosversion 6; then
/etc/init.d/iptables status > /dev/null 2>&1
if [ $? -eq 0 ]; then
iptables -L -n | grep -i 20086 > /dev/null 2>&1
if [ $? -ne 0 ]; then
iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 20086 -j ACCEPT
iptables -I INPUT -m state --state NEW -m udp -p udp --dport 20086 -j ACCEPT
/etc/init.d/iptables save
/etc/init.d/iptables restart
else
echo -e "[${green}Info${plain}] 20086已放行."
fi
else
echo -e "[${yellow}Warning${plain}] iptables 似乎已关闭或者未安装."
fi
elif centosversion 7; then
systemctl status firewalld > /dev/null 2>&1
if [ $? -eq 0 ]; then
firewall-cmd --permanent --zone=public --add-port=20086/tcp
firewall-cmd --permanent --zone=public --add-port=20086/udp
firewall-cmd --reload
else
echo -e "[${yellow}Warning${plain}] firewalld 似乎未运行或未安装."
fi
fi
echo -e "[${green}Info${plain}] firewall 设置完成..."
}
# Install pubg radar
install_radar(){
git clone https://github.com/794959818/pubgradar.git
cd pubgradar
npm i
# if check_sys packageManager yum; then
# npm i -g pino
# npm install -g forever
# elif check_sys packageManager apt; then
npm i -g pino
npm install -g forever
# fi
}
# start up pubg radar
start_radar(){
cd ${cur_dir} && cd pubgradar
ifconfig
IP=$(ifconfig -a | grep inet | grep -v 127.0.0.1 | grep -v inet6 | awk '{print $2}' | tr -d "addrs:")
read -p "请输入网卡名称: " eth
echo -e "[${green}内网IP${plain}]:${IP}"
read -p "请输入内网ip: " ip
forever start index.js sniff $eth $ip | pino
echo -e "[${green}访问地址${plain}]:${IP}:20086"
}
# Install pubg radar
install_pubgradar(){
disable_selinux
install_shadowsocksr
pre_install
firewall_set
install_radar
start_radar
}
# Initialization step
action=$1
[ -z $1 ] && action=install
case "$action" in
install)
${action}_pubgradar
;;
*)
echo "Arguments error! [${action}]"
echo "Usage: `basename $0` [install]"
;;
esac |
it works!!但是内网ip到底要填什么... lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 @AlphaBrock 假如dalao知道的话麻烦解答下咯 |
@prprshooter |
/root/pubgradar/backend/bunchstash.js:148 Error: 1079804250 (NumGUIDsInBunch) > 2048 /root/pubgradar/backend/uebuffer.js:63 |
No description provided.
The text was updated successfully, but these errors were encountered: