Skip to content

Commit

Permalink
startup: avoid repeating file actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bertsky committed Feb 7, 2024
1 parent e8c06e0 commit 0294d74
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion startup.sh
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -23,7 +26,7 @@ EOF
fi

# turn off the login banner
touch /.hushlogin
> /.hushlogin

set | fgrep -ve BASH >/.ssh/environment

Expand All @@ -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

Expand Down

0 comments on commit 0294d74

Please sign in to comment.