blob: 0fd43ffc32963c467976c60a19b077d8fe3e1857 [file] [log] [blame]
Andrew Grimberg78bc6d52017-10-13 12:55:05 -07001#!/bin/bash
2
3# vim: ts=4 sw=4 sts=4 et tw=72 :
4
5# force any errors to cause the script and job to end in failure
6set -xeu -o pipefail
7
8rh_systems() {
9 echo 'No changes to apply'
10}
11
12ubuntu_systems() {
13 apt-get clean
14 apt-get update
15 echo 'No changes to apply'
16}
17
18all_systems() {
19 echo 'No common distribution configuration to perform'
20}
21
22echo "---> Detecting OS"
23ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
24
25case "${ORIGIN}" in
26 fedora|centos|redhat)
27 echo "---> RH type system detected"
28 rh_systems
29 ;;
30 ubuntu)
31 echo "---> Ubuntu system detected"
32 ubuntu_systems
33 ;;
34 *)
35 echo "---> Unknown operating system"
36 ;;
37esac
38
39# execute steps for all systems
40all_systems