File: system.bash

package info (click to toggle)
resource-agents-paf 2.2.1-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 340 kB
  • sloc: perl: 1,811; sh: 208; makefile: 27
file content (27 lines) | stat: -rwxr-xr-x 463 bytes parent folder | download
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
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

NODENAME="$1"
shift
NODES=( "$@" )

hostnamectl set-hostname "${NODENAME}"

for N in "${NODES[@]}"; do
    NG=$(sed -n "/${N%=*}\$/p" /etc/hosts|wc -l)
    if [ "$NG" -eq 0 ]; then
        echo "${N##*=} ${N%=*}" >> /etc/hosts
    fi
done

PACKAGES=(
    screen vim
)

yum install --nogpgcheck --quiet -y -e 0 "${PACKAGES[@]}"

# force proper permissions on .ssh files
chmod -R 0600 /root/.ssh/