-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-server.sh
More file actions
executable file
·37 lines (28 loc) · 927 Bytes
/
build-server.sh
File metadata and controls
executable file
·37 lines (28 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# (c)2020 Brian Sidebotham <brian.sidebotham@gmail.com>
# License: MIT
# Script to create a salt master on a CentOS 8.1 minimal install server
scriptdir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
basedir="${scriptdir}"
servername=$(basename ${0})
libdir="${basedir}/lib"
source "${libdir}"/lib.sh
echo "Building ${servername} for $(os_id) $(os_version_id)"
scriptfile_common="$(os_id)/${servername}"
scriptfile="$(os_id)/$(os_version_id)/${servername}"
if [ -f "${scriptfile_common}" ]; then
must_succeed_or_exit /bin/bash ${scriptfile_common}
if [ ! -f "${scriptfile}" ]; then
exit 0
fi
fi
if [ -f "${scriptfile}" ]; then
must_succeed_or_exit /bin/bash ${scriptfile}
if [ ! -f "${scriptfile}" ]; then
exit 0
fi
fi
echo "Don't have a script for this server/application combination" >&2
echo "common: ${scriptfile_common}" >&2
echo "script: ${scriptfile}" >&2
exit 1