File: install_conntrack.sh

package info (click to toggle)
python-os-xenapi 0.3.4-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,012 kB
  • sloc: python: 8,137; sh: 2,154; makefile: 45
file content (17 lines) | stat: -rw-r--r-- 553 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
set -e

REPO_NAME="CentOS-Base.repo"
REPO_PATH="/etc/yum.repos.d/$REPO_NAME"
TMP_REPO_DIR="/tmp/repo/"
TMP_REPO_PATH=$TMP_REPO_DIR$REPO_NAME
PKG_NAME="conntrack-tools"

if ! yum list installed $PKG_NAME; then
    mkdir -p $TMP_REPO_DIR
    cp $REPO_PATH $TMP_REPO_DIR
    sed -i s/#baseurl=/baseurl=/g $TMP_REPO_PATH
    centos_ver=$(yum version nogroups |grep Installed | cut -d' ' -f 2 | cut -d'/' -f 1 | cut -d'-' -f 1)
    yum install -y -c $TMP_REPO_PATH --enablerepo=base --releasever=$centos_ver $PKG_NAME
    rm -rf $TMP_REPO_DIR
fi