Skip to content

Commit 7eded8f

Browse files
committed
Adding pipefail to main executables
Adding pipefail to 21-ssl
1 parent 9f16ad3 commit 7eded8f

File tree

9 files changed

+40
-33
lines changed

9 files changed

+40
-33
lines changed

overlay/etc/cont-init.d/20-paths

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/with-contenv bash
22

3+
set -euo pipefail
4+
5+
36
#======================================================================================================================
47
# Add environment variable to S6 environment directory
58
#======================================================================================================================

overlay/etc/cont-init.d/21-ssl

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,27 @@
11
#!/usr/bin/with-contenv bash
22

3+
set -euo pipefail
4+
5+
36
#======================================================================================================================
47
# Check for clean install
58
#======================================================================================================================
69

7-
if [ ! -f ${SSL_GLOBAL_CFG} ] || [ "${CLEAN_INSTALL}" = "1" ] ; then
8-
9-
if [ "${CLEAN_INSTALL}" = "1" ] ; then
10-
_echo "Clean install detected, cleaning ${SSL_CERTS} and ${SITES}..."
11-
12-
if [ -z "${SSL_GLOBAL_CFG}" ] ; then
13-
_error "SSL_GLOBAL_CFG not defined."
14-
exit 1
15-
else
16-
rm -f ${SSL_GLOBAL_CFG}
17-
fi
18-
19-
if [ -z "${SSL_CERTS}" ] ; then
20-
_error "SSL_CERTS not defined."
21-
exit 1
22-
else
23-
rm -rf ${SSL_CERTS}/*
24-
fi
25-
26-
if [ -z "${SITES}" ] ; then
27-
_error "SITES not defined."
28-
exit 1
29-
else
30-
rm -rf ${SITES}/*
31-
fi
32-
33-
_done
34-
fi
35-
10+
if [ "${CLEAN_INSTALL}" = "1" ] ; then
11+
12+
_echo "Clean install detected, cleaning ${SSL_CERTS} and ${SITES}..."
13+
14+
[[ -z "${SSL_GLOBAL_CFG}" ]] && _error "SSL_GLOBAL_CFG not defined."
15+
rm -rf ${SSL_GLOBAL_CFG}
16+
17+
[[ -z "${SSL_CERTS}" ]] && _error "SSL_CERTS not defined."
18+
rm -rf ${SSL_CERTS}/*
19+
20+
[[ -z "${SITES}" ]] && _error "SITES not defined."
21+
rm -rf ${SITES}/*
22+
23+
_done
24+
3625
fi
3726

3827

overlay/etc/fix-attrs.d/20-ssl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/ssl true www:www 0644 0755
2-
/etc/ssl/certs false www:www 0644 0755
1+
/ssl true www:www 0640 0750
2+
/etc/ssl/certs false www:www 0640 0750

overlay/etc/fix-attrs.d/21-sites

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/sites true www:www 0644 0755
2-
/etc/nginx/sites false www:www 0644 0755
1+
/sites true www:www 0640 0750
2+
/etc/nginx/sites false www:www 0640 0750

overlay/usr/local/bin/nginx-regenerate

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/with-contenv bash
22

3+
set -euo pipefail
4+
5+
36
#======================================================================================================================
47
# Delete Nginx configuration files and reinitialise
58
#======================================================================================================================

overlay/usr/local/bin/ssl-init

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/with-contenv bash
22

3+
set -euo pipefail
4+
5+
36
#======================================================================================================================
47
# Run /etc/ssl/init executable
58
#======================================================================================================================

overlay/usr/local/bin/ssl-regenerate

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/with-contenv bash
22

3+
set -euo pipefail
4+
5+
36
#======================================================================================================================
47
# Delete SSL files and reinitialise
58
#======================================================================================================================

overlay/usr/local/bin/ssl-request

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

3+
set -euo pipefail
4+
5+
36
#======================================================================================================================
47
# Run /etc/ssl/request executable
58
#======================================================================================================================

overlay/usr/local/bin/ssl-update

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

3+
set -euo pipefail
4+
5+
36
#======================================================================================================================
47
# Run /etc/ssl/update executable
58
#======================================================================================================================

0 commit comments

Comments
 (0)