Merge pull request #18 from eest/cosmos-set-root-perms

Make overlay permission script global
This commit is contained in:
Fredrik Thulin 2022-12-05 15:08:49 +01:00 committed by GitHub
commit 46aecacb06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,19 @@
#!/bin/sh
#
# Set overlay file permissions in model directory before apply.d/60overlay
# rsyncs it to /
#
set -e
self=$(basename "$0")
MODEL_OVERLAY="$COSMOS_MODEL/overlay"
if ! test -d "$MODEL_OVERLAY"; then
test -z "$COSMOS_VERBOSE" || echo "$self: overlay is a no-op"
exit 0
fi
if [ -d "$MODEL_OVERLAY/root" ]; then
chmod -v 0700 "$MODEL_OVERLAY"/root
fi