krebs.permown: admit symlinks

This commit is contained in:
tv 2019-04-18 11:00:56 +02:00
parent 64d6955e5a
commit 1bbd53c459

View File

@ -61,7 +61,7 @@ with import <stockholm/lib>;
ExecStart = pkgs.writeDash "permown" ''
set -efu
find "$ROOT_PATH" -exec chown "$OWNER_GROUP" {} +
find "$ROOT_PATH" -exec chown -h "$OWNER_GROUP" {} +
find "$ROOT_PATH" -type d -exec chmod "$DIR_MODE" {} +
find "$ROOT_PATH" -type f -exec chmod "$FILE_MODE" {} +
@ -70,8 +70,10 @@ with import <stockholm/lib>;
if test -d "$path"; then
exec "$0" "$@"
fi
chown "$OWNER_GROUP" "$path"
chmod "$FILE_MODE" "$path"
chown -h "$OWNER_GROUP" "$path"
if test -f "$path"; then
chmod "$FILE_MODE" "$path"
fi
done
'';
Restart = "always";