480752
#!/bin/bash
480752
# This script delivers current documentation/configs and assures it has the intended
480752
# settings for a particular branch/release.
480752
# For questions reach to Jindrich Novy <jnovy@redhat.com>
480752
480752
ensure() {
480752
  if grep ^$2[[:blank:]].*= $1 > /dev/null
480752
  then
480752
    sed -i "s;^$2[[:blank:]]=.*;$2 = $3;" $1
480752
  else
480752
    if grep ^\#.*$2[[:blank:]].*= $1 > /dev/null
480752
    then
480752
      sed -i "/^#.*$2[[:blank:]].*=/a \
480752
$2 = $3" $1
480752
    else
480752
      echo "$2 = \"$3\"" >> $1
480752
    fi
480752
  fi
480752
}
480752
6511ce
#./pyxis.sh
6511ce
#./update-vendored.sh
480752
spectool -f -g skopeo.spec
480752
ensure storage.conf    driver                        \"overlay\"
480752
ensure storage.conf    mountopt                      \"nodev,metacopy=on\"
480752
ensure containers.conf events_logger                 \"file\"
6511ce
if pwd | grep rhel-8 > /dev/null
6511ce
then
6511ce
ensure registries.conf unqualified-search-registries [\"registry.fedoraproject.org\",\ \"registry.access.redhat.com\",\ \"registry.centos.org\",\ \"docker.io\"]
6dac66
ensure registries.conf short-name-mode               \"permissive\"
480752
ensure containers.conf infra_image                   \"registry.access.redhat.com/ubi8/pause\"
480752
ensure containers.conf runtime                       \"runc\"
6511ce
else
6511ce
ensure registries.conf unqualified-search-registries [\"registry.fedoraproject.org\",\ \"registry.access.redhat.com\",\ \"registry.centos.org\",\ \"quay.io\",\ \"docker.io\"]
6511ce
ensure registries.conf short-name-mode               \"enforcing\"
6511ce
ensure containers.conf infra_image                   \"registry.access.redhat.com/ubi9/pause\"
6511ce
ensure containers.conf runtime                       \"crun\"
6511ce
fi
480752
[ `grep "keyctl" seccomp.json | wc -l` == 0 ] && sed -i '/\"kill\",/i \
480752
				"keyctl",' seccomp.json
480752
sed -i '/\"socketcall\",/i \
480752
				"socket",' seccomp.json
480752
if ! grep \"NET_RAW\" containers.conf > /dev/null
480752
then
480752
  sed -i '/^default_capabilities/a \
480752
    "NET_RAW",' containers.conf
480752
fi