From 87b7fcbae2b6a0fe4d0dce5343c6c9a2976f9990 Mon Sep 17 00:00:00 2001
From: alex-phillips <ahp118@gmail.com>
Date: Wed, 15 May 2019 07:56:34 -0400
Subject: [PATCH] added support for custom services.d

---
 root/etc/cont-init.d/99-custom-scripts | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/root/etc/cont-init.d/99-custom-scripts b/root/etc/cont-init.d/99-custom-scripts
index 7e4c16b..3a691f3 100644
--- a/root/etc/cont-init.d/99-custom-scripts
+++ b/root/etc/cont-init.d/99-custom-scripts
@@ -13,3 +13,17 @@ if [ -e "${SCRIPTS_DIR}" ] && \
 else
     echo "[custom-init] no custom scripts found exiting..."
 fi
+
+# Make sure custom services directory exists and has files in it
+SERVICES_DIR="/config/custom-services.d"
+if [ -e "${SERVICES_DIR}" ] && \
+   [ -n "$(/bin/ls -A ${SERVICES_DIR} 2>/dev/null)" ]; then
+    echo "[custom-init] service folders found in ${SERVICES_DIR} executing"
+    for SERVICE in ${SERVICES_DIR}/*; do
+        echo "[custom-init] ${SERVICE}: copying..."
+        cp -r ${SERVICE} /etc/services.d/
+        echo "[custom-init] ${SERVICE}: done"
+    done
+else
+    echo "[custom-init] no custom services found exiting..."
+fi
-- 
GitLab