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