代码拉取完成,页面将自动刷新
#!/bin/bash
CheckSysAndInstallSngrep()
{
if grep -Eqii "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
echo 'CentOS'
CentOSInstallSngrep
elif grep -Eqi "Red Hat Enterprise Linux Server" /etc/issue || grep -Eq "Red Hat Enterprise Linux Server" /etc/*-release; then
echo 'RHEL'
CentOSInstallSngrep
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
echo 'Debian'
DebianInstallSngrep
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
echo 'Ubuntu'
UbuntuInstallSngrep
else
echo 'unknow system'
fi
}
DebianInstallSngrep(){
cat >> /etc/apt/sources.list <<-'EOF'
deb http://packages.irontec.com/debian squeeze main
deb http://packages.irontec.com/debian wheezy main
deb http://packages.irontec.com/debian jessie main
deb http://packages.irontec.com/debian stretch main
EOF
wget http://packages.irontec.com/public.key -q -O - | apt-key add -
apt-get update
apt-get install sngrep
}
UbuntuInstallSngrep(){
cat >> /etc/apt/sources.list <<-'EOF'
deb http://packages.irontec.com/ubuntu trusty main
deb http://packages.irontec.com/ubuntu precise main
deb http://packages.irontec.com/ubuntu vivid main
deb http://packages.irontec.com/ubuntu xenial main
deb http://packages.irontec.com/ubuntu zesty main
deb http://packages.irontec.com/ubuntu artful main
EOF
wget http://packages.irontec.com/public.key -q -O - | apt-key add -
apt-get update
apt-get install sngrep
}
CentOSInstallSngrep(){
cat >> /etc/yum.repos.d/irontec.repo <<-'EOF'
[irontec]
name=Irontec RPMs repository
baseurl=http://packages.irontec.com/centos/\$releasever/\$basearch/
EOF
rpm --import http://packages.irontec.com/public.key
yum install sngrep -y
}
CheckSysAndInstallSngrep
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。