diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-swag-ioncube-setup/dependencies.d/init-mods b/root/etc/s6-overlay/s6-rc.d/init-mod-swag-ioncube-setup/dependencies.d/init-mods new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-swag-ioncube-setup/run b/root/etc/s6-overlay/s6-rc.d/init-mod-swag-ioncube-setup/run new file mode 100755 index 0000000..f435e2d --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-swag-ioncube-setup/run @@ -0,0 +1,42 @@ +#!/usr/bin/with-contenv bash +echo "**** Installing Ioncube Loader ****" + +if php -m | grep -iq "ioncube"; then + echo "**** Ioncube Loader already installed, exiting... ****" + exit 0 +else + ARCH="$(command arch)" + if [ "${ARCH}" = "x86_64" ]; then + ARCH="x86-64" + echo "**** Linux architecture found: x86-64 ****" + elif [ "${ARCH}" = "aarch64" ]; then + ARCH="aarch64" + echo "**** Linux architecture found: arm64 ****" + elif [ "${ARCH}" = "armv7l" ]; then + ARCH="armv7l" + echo "**** Linux architecture found: armhf ****" + else + echo "**** Unsupported Linux architecture ${ARCH} found, exiting... ****" + exit 1 + fi + + PHP_MAJOR_VERSION="$(command php -r 'echo PHP_MAJOR_VERSION;')" + PHP_MINOR_VERSION="$(command php -r 'echo PHP_MINOR_VERSION;')" + echo "**** PHP Version found: ${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}.x ****" + + echo "**** Downloading Ioncube Loader... ****" + wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${ARCH}.tar.gz -P /tmp/ + echo "**** Ioncube Loader downloaded: ioncube_loaders_lin_${ARCH}.tar.gz ****" + + echo "**** Extracting Ioncube Loader... ****" + tar -C /tmp -xzvf /tmp/ioncube_loaders_lin_${ARCH}.tar.gz \ + && mkdir -p /usr/local/ioncube && cp /tmp/ioncube/*.so /usr/local/ioncube \ + && rm /tmp/ioncube_loaders_lin_${ARCH}.tar.gz && rm -rf /tmp/ioncube + echo "**** Ioncube Loader extracted: /usr/local/ioncube ****" + + echo "zend_extension = /usr/local/ioncube/ioncube_loader_lin_${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}.so" \ + > /etc/php${PHP_MAJOR_VERSION}/conf.d/00-ioncube.ini + echo "**** Ioncube Loader PHP extension enabled: ioncube_loader_lin_${PHP_MAJOR_VERSION}.${PHP_MINOR_VERSION}.so ****" + + echo "**** Ioncube Loader Installed ****" +fi diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-swag-ioncube-setup/type b/root/etc/s6-overlay/s6-rc.d/init-mod-swag-ioncube-setup/type new file mode 100644 index 0000000..3d92b15 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-swag-ioncube-setup/type @@ -0,0 +1 @@ +oneshot \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-swag-ioncube-setup/up b/root/etc/s6-overlay/s6-rc.d/init-mod-swag-ioncube-setup/up new file mode 100644 index 0000000..c4bbe30 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-swag-ioncube-setup/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-mod-swag-ioncube-setup/run \ No newline at end of file diff --git a/root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mod-swag-ioncube-setup b/root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mod-swag-ioncube-setup new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mod-swag-ioncube-setup b/root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mod-swag-ioncube-setup new file mode 100644 index 0000000..e69de29