From 0294d7429178e965798407a87943e91e17177a0a Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Wed, 7 Feb 2024 02:09:19 +0100 Subject: [PATCH] startup: avoid repeating file actions --- startup.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/startup.sh b/startup.sh index 7cf713d..135f0a3 100755 --- a/startup.sh +++ b/startup.sh @@ -1,4 +1,7 @@ #! /bin/bash +# avoid repeating file actions when restarting container: +if ! grep -q ^ocrd: /etc/passwd; then + cat /authorized_keys >>/.ssh/authorized_keys cat /id_rsa >>/.ssh/id_rsa @@ -23,7 +26,7 @@ EOF fi # turn off the login banner -touch /.hushlogin +> /.hushlogin set | fgrep -ve BASH >/.ssh/environment @@ -49,6 +52,9 @@ echo ocrd:*:19020:0:99999:7::: >>/etc/shadow /bin/sed -i '/imklog/s/^/#/' /etc/rsyslog.conf # rsyslog upd reception on port 514 /bin/sed -i '/imudp/s/^#//' /etc/rsyslog.conf + +fi + # start syslog service rsyslog start