From 4aebbd2a76e48ace73a9f290887f42af60644446 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 12 Jun 2024 14:21:40 +0200 Subject: [slx-extra-script] New module to run script from URL --- modules.d/slx-extra-script/hooks/s3-extra-script.sh | 10 ++++++++++ modules.d/slx-extra-script/module-setup.sh | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 modules.d/slx-extra-script/hooks/s3-extra-script.sh create mode 100755 modules.d/slx-extra-script/module-setup.sh (limited to 'modules.d/slx-extra-script') diff --git a/modules.d/slx-extra-script/hooks/s3-extra-script.sh b/modules.d/slx-extra-script/hooks/s3-extra-script.sh new file mode 100755 index 00000000..3a8d4ff4 --- /dev/null +++ b/modules.d/slx-extra-script/hooks/s3-extra-script.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# -*- coding: utf-8 -*- +# region imports +. /etc/openslx +# endregion + +[ -z "$SLX_EXTRA_SCRIPT_URL" ] && exit 0 +slx-tools download_retry --slx-time 20 -sS "$SLX_EXTRA_SCRIPT_URL" > /tmp/extra-init || exit 1 +chmod +x /tmp/extra-init +exec /tmp/extra-init diff --git a/modules.d/slx-extra-script/module-setup.sh b/modules.d/slx-extra-script/module-setup.sh new file mode 100755 index 00000000..02f61391 --- /dev/null +++ b/modules.d/slx-extra-script/module-setup.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +check() { + return 255 +} +depends() { + echo conf-tgz +} +install() { + slx_service "s3-extra-script" "Execute extra script from URL" \ + --wafter "s3-fetch-config.service" \ + --before "s3-dnbd3root.service" +} -- cgit v1.2.3-55-g7522