Blame tests/p_ipa-server/99-postclean.sh

James Hogarth 62aaba
#!/bin/bash
James Hogarth 62aaba
# Author: James Hogarth <james.hogarth@gmail.com>
James Hogarth 62aaba
#
88f3cf
if [ "$PRE_UPDATES" == "1" ]; then
88f3cf
  t_Log "skipping $0 for pre update testing"
88f3cf
  exit 0
88f3cf
fi
James Hogarth 62aaba
c1e011
if (t_GetPkgRel basesystem | grep -qE 'el(6|7)') && !(t_GetArch | grep -qE 'aarch64')
c3b6d5
  then
Christoph Galuschka 608dd4
  if (t_GetPkgRel basesystem | grep -qE 'el(6)')
Christoph Galuschka 608dd4
    then
Christoph Galuschka 608dd4
    CP=/bin/cp
Christoph Galuschka 608dd4
  fi
Christoph Galuschka 608dd4
  if (t_GetPkgRel basesystem | grep -qE 'el(7)')
Christoph Galuschka 608dd4
    then
Christoph Galuschka 608dd4
    CP=/usr/bin/cp
Christoph Galuschka 608dd4
  fi
James Hogarth 62aaba
c3b6d5
  t_Log "Running $0 - Restoring up resolv.conf"
Christoph Galuschka 608dd4
  ${CP} /tmp/resolv.conf.ipa-tests /etc/resolv.conf
James Hogarth 62aaba
c3b6d5
  t_Log "Running $0 - Restoring nsswitch.conf"
Christoph Galuschka 608dd4
  ${CP} /tmp/nsswitch.conf.ipa-tests /etc/nsswitch.conf
James Hogarth 62aaba
c3b6d5
  t_Log "Running $0 - Restoring  hosts file"
Christoph Galuschka 608dd4
  ${CP} /tmp/hosts.ipa-tests /etc/hosts
James Hogarth 62aaba
c3b6d5
  if [[ -f /tmp/ntp.conf.ipa-tests ]]
c3b6d5
    then
c3b6d5
    t_Log "Running $0 - Restoring  ntp.conf file"
Christoph Galuschka 608dd4
    ${CP} /tmp/ntp.conf.ipa-tests /etc/ntp.conf
c3b6d5
  fi
c3b6d5
c3b6d5
  t_Log "Running $0 - Rolling back to yum history id - this will take some time"
c3b6d5
    /usr/bin/yum -y history rollback $(cat /tmp/yum-rollback-id.ipa-tests) &> /dev/null
James Hogarth 1deb36
d03e0c
  t_Log "Running $0 - Restoring ssh_config"
Christoph Galuschka 608dd4
  ${CP} /etc/ssh/ssh_config.ipa-tests /etc/ssh/ssh_config
d03e0c
d03e0c
  
c3b6d5
  rm -f /tmp/*.ipa-test /etc/httpd/conf.d/*
James Hogarth 62aaba
c3b6d5
  if [ "$centos_ver" = "7" ] ; then
c3b6d5
    hostnamectl set-hostname $(cat /tmp/hostname.ipa-tests) 
c3b6d5
  else
c3b6d5
    hostname $(cat /tmp/hostname.ipa-tests)
c3b6d5
  fi
James Hogarth 62aaba
James Hogarth 62aaba
else
c1e011
    echo "Skipped on CentOS 5 and AArch64"
James Hogarth 62aaba
fi
James Hogarth 62aaba