2022-12-05 12:26:20 +00:00
|
|
|
#!/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
|
|
|
|
|
2023-11-17 13:58:51 +00:00
|
|
|
args=""
|
|
|
|
if [ "x$COSMOS_VERBOSE" = "xy" ]; then
|
|
|
|
args="-v"
|
|
|
|
fi
|
|
|
|
|
2022-12-05 12:26:20 +00:00
|
|
|
if [ -d "$MODEL_OVERLAY/root" ]; then
|
2023-11-17 13:58:51 +00:00
|
|
|
chown ${args} root:root "$MODEL_OVERLAY"/root
|
2023-02-03 15:04:51 +00:00
|
|
|
chmod ${args} 0700 "$MODEL_OVERLAY"/root
|
2022-12-05 12:26:20 +00:00
|
|
|
fi
|
2023-11-17 13:58:51 +00:00
|
|
|
|
|
|
|
if [ -d "$MODEL_OVERLAY/root/.ssh" ]; then
|
|
|
|
chown ${args} -R root:root "$MODEL_OVERLAY"/root/.ssh
|
|
|
|
chmod ${args} 0700 "$MODEL_OVERLAY"/root/.ssh
|
|
|
|
fi
|