From 89f93b5558fc8882c5f6dce9532298e0bdee4d74 Mon Sep 17 00:00:00 2001 From: Olivier FAURAX Date: Thu, 25 Jul 2024 10:13:39 +0000 Subject: [PATCH] Add a task.sh to run things when container starts --- task.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 task.sh diff --git a/task.sh b/task.sh new file mode 100644 index 00000000..6a2f570a --- /dev/null +++ b/task.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +echo "Welcome to Alloy Inband container" + +alloy inband + +cat <<"EOF" > /statedir/cleanup.sh +#!/usr/bin/env bash +echo "This is the cleanup script.sh" +for i in {1..10} +do + echo $i + sleep 1 +done +reboot +EOF +chmod +x /statedir/cleanup.sh + +echo "task.sh is now finished, cleanup.sh will reboot after 10s"