加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
install_sngrep.sh 1.80 KB
一键复制 编辑 原始数据 按行查看 历史
c.long 提交于 2022-05-06 14:31 . Create install_sngrep.sh
#!/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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化