Skip to content

Commit 9c47c6c

Browse files
committed
Make the scripts more bulletproof
1 parent e2b6149 commit 9c47c6c

File tree

9 files changed

+19
-1
lines changed

9 files changed

+19
-1
lines changed

elements/centos-kmods-sig/install.d/95-kmods-sig-packages

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash -lv
22

3+
set -euo pipefail
4+
35
if [[ ${DISTRO_NAME} == centos && -n ${DIB_CENTOS_KMODS_PKGLIST} ]]; then
46
dnf install -y ${DIB_CENTOS_KMODS_PKGLIST}
57
else

elements/centos-kmods-sig/pre-install.d/01-kmods-sig-repo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash -lv
22

3+
set -euo pipefail
4+
35
case "$DISTRO_NAME" in
46
centos* )
57

elements/dhcp-on/install.d/95-dhcp-on

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/bin/bash
22

3+
set -euo pipefail
4+
35
if [ ! -d /etc/sysconfig/network-scripts ]
46
then
57
return -1
68
fi
79

8-
# If there is no existing network configuration for the given device,
10+
# If there is no existing network configuration for the given device,
911
# create a catch-all DHCP configuration for this network interface.
1012
if [ ! -e /etc/sysconfig/network-scripts/ifcfg-$DHCP_ON_DEV ]
1113
then

elements/dhcp-on/post-install.d/95-dhcp-on

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
set -euo pipefail
4+
35
# Purge the cloud image default network configuration
46
if [ "$DHCP_ON_DEV" != "eth0" ]
57
then

elements/elrepo/install.d/95-elrepo-packages

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash -lv
22

3+
set -euo pipefail
4+
35
if [[ ${DISTRO_NAME} =~ (centos|rhel) && -n ${DIB_ELREPO_PKGLIST} ]]; then
46
dnf install -y "${DIB_ELREPO_PKGLIST}"
57
else

elements/elrepo/pre-install.d/01-elrepo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash -lv
22

3+
set -euo pipefail
4+
35
case "$DISTRO_NAME" in
46
centos* | rhel*)
57
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

elements/nvidia-cuda/install.d/95-nvidia-cuda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash -lv
22

3+
set -euo pipefail
4+
35
case "$DISTRO_NAME" in
46
centos* | rhel*)
57
KERNEL_VERSION=$(ls /boot/vmlinuz*x86_64 | sort -n | tail -n1 | cut -d'-' -f2-)

elements/nvidia-cuda/post-install.d/95-nvidia-cuda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash -lv
22

3+
set -euo pipefail
4+
35
if [ "$NVIDIA_CUDA_DELETE_REPO" = "y" -o "$NVIDIA_CUDA_DELETE_REPO" = "Y" ]
46
then
57
case "$DISTRO_NAME" in

elements/nvidia-cuda/pre-install.d/01-nvidia-cuda-repo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash -lv
22

3+
set -euo pipefail
4+
35
case "$DISTRO_NAME" in
46
centos* | rhel*)
57
yum install -y ${NVIDIA_CUDA_REPO}/cuda-repo-${NVIDIA_CUDA_DISTRO}-${NVIDIA_CUDA_VERSION}.x86_64.rpm

0 commit comments

Comments
 (0)