diff --git a/rootfs/etc/s6-overlay/s6-rc.d/crond/dependencies.d/init-wpconfig-verify b/rootfs/etc/s6-overlay/s6-rc.d/crond/dependencies.d/init-wpconfig-verify new file mode 100644 index 0000000..e69de29 diff --git a/rootfs/etc/s6-overlay/s6-rc.d/init-install-resources/dependencies.d/init-wpconfig-verify b/rootfs/etc/s6-overlay/s6-rc.d/init-install-resources/dependencies.d/init-wpconfig-verify new file mode 100644 index 0000000..e69de29 diff --git a/rootfs/etc/s6-overlay/s6-rc.d/init-wpconfig-verify/dependencies.d/base b/rootfs/etc/s6-overlay/s6-rc.d/init-wpconfig-verify/dependencies.d/base new file mode 100644 index 0000000..e69de29 diff --git a/rootfs/etc/s6-overlay/s6-rc.d/init-wpconfig-verify/run b/rootfs/etc/s6-overlay/s6-rc.d/init-wpconfig-verify/run new file mode 100755 index 0000000..e93afc2 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/init-wpconfig-verify/run @@ -0,0 +1,58 @@ +#!/command/with-contenv bash +# shellcheck shell=bash + +checkSaltsEnv() { + if [ -z "${WORDPRESS_AUTH_KEY}" ]; then + echo "- WORDPRESS_AUTH_KEY is not set" + return 1 + fi + + if [ -z "${WORDPRESS_SECURE_AUTH_KEY}" ]; then + echo "- WORDPRESS_SECURE_AUTH_KEY is not set" + return 1 + fi + + if [ -z "${WORDPRESS_LOGGED_IN_KEY}" ]; then + echo "- WORDPRESS_LOGGED_IN_KEY is not set" + return 1 + fi + + if [ -z "${WORDPRESS_NONCE_KEY}" ]; then + echo "- WORDPRESS_NONCE_KEY is not set" + return 1 + fi + + if [ -z "${WORDPRESS_AUTH_SALT}" ]; then + echo "- WORDPRESS_AUTH_SALT is not set" + return 1 + fi + + if [ -z "${WORDPRESS_SECURE_AUTH_SALT}" ]; then + echo "- WORDPRESS_SECURE_AUTH_SALT is not set" + return 1 + fi + + if [ -z "${WORDPRESS_LOGGED_IN_SALT}" ]; then + echo "- WORDPRESS_LOGGED_IN_SALT is not set" + return 1 + fi + + if [ -z "${WORDPRESS_NONCE_SALT}" ]; then + echo "- WORDPRESS_NONCE_SALT is not set" + return 1 + fi +} + +# init-wpconfig-verify main +main() { + # This will prepend service name to all output from here + exec > >(while read -r line; do echo "[init-wpconfig-verify] ${line}"; done) 2>&1 + + echo "Checking salts..." + if ! checkSaltsEnv; then + echo "^^^ Some or all of the salts are not set. Cannot continue." + return 1 + fi + +} +main diff --git a/rootfs/etc/s6-overlay/s6-rc.d/init-wpconfig-verify/type b/rootfs/etc/s6-overlay/s6-rc.d/init-wpconfig-verify/type new file mode 100644 index 0000000..3d92b15 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/init-wpconfig-verify/type @@ -0,0 +1 @@ +oneshot \ No newline at end of file diff --git a/rootfs/etc/s6-overlay/s6-rc.d/init-wpconfig-verify/up b/rootfs/etc/s6-overlay/s6-rc.d/init-wpconfig-verify/up new file mode 100644 index 0000000..55d8ab3 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/init-wpconfig-verify/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-wpconfig-verify/run \ No newline at end of file diff --git a/rootfs/etc/s6-overlay/s6-rc.d/unitd/dependencies.d/init-wpconfig-verify b/rootfs/etc/s6-overlay/s6-rc.d/unitd/dependencies.d/init-wpconfig-verify new file mode 100644 index 0000000..e69de29 diff --git a/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/init-wpconfig-verify b/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/init-wpconfig-verify new file mode 100644 index 0000000..e69de29