From d615adc0228b1e14a31525c10f14b4f1f403897f Mon Sep 17 00:00:00 2001 From: Sashwat K Date: Thu, 22 Jan 2026 22:28:05 +0530 Subject: [PATCH] feat: add loop for encryption --- log-encryption/compose/bin/example.sh | 13 ++++++++++--- log-encryption/pods/bin/example.sh | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/log-encryption/compose/bin/example.sh b/log-encryption/compose/bin/example.sh index 9f01e42..d598de1 100644 --- a/log-encryption/compose/bin/example.sh +++ b/log-encryption/compose/bin/example.sh @@ -4,6 +4,13 @@ set -eu apt-get update apt-get install -y openssl -echo "To be, or not to be, that is the question:" -echo "This message is generated by a Docker Compose Contract." \ - | /bin/bash /var/logging/bin/encrypt-log.sh /var/logging/logging.pub +# Run infinite loop +while true; do + date | while IFS= read -r line; do + # Print to screen + echo "Screen: $line" + # Send to your encrypt script + echo "$line" | /bin/bash /var/logging/bin/encrypt-log.sh /var/logging/logging.pub + done + sleep 1 +done diff --git a/log-encryption/pods/bin/example.sh b/log-encryption/pods/bin/example.sh index 2f75cb1..d598de1 100644 --- a/log-encryption/pods/bin/example.sh +++ b/log-encryption/pods/bin/example.sh @@ -4,6 +4,13 @@ set -eu apt-get update apt-get install -y openssl -echo "To be, or not to be, that is the question:" -echo "This message is generated from Podman Play Contract." \ - | /bin/bash /var/logging/bin/encrypt-log.sh /var/logging/logging.pub +# Run infinite loop +while true; do + date | while IFS= read -r line; do + # Print to screen + echo "Screen: $line" + # Send to your encrypt script + echo "$line" | /bin/bash /var/logging/bin/encrypt-log.sh /var/logging/logging.pub + done + sleep 1 +done