Update ha_entrypoint_modif.sh

This commit is contained in:
Alexandre
2023-12-25 07:13:36 +01:00
committed by GitHub
parent d12680522f
commit e7617c3002

View File

@@ -8,9 +8,18 @@ set -e
# Ensure lf # Ensure lf
########### ###########
for folders in /default /defaults /etc; do # This script recursively applies dos2unix to all files in /etc
if [ -d "$folders" ]; then # It skips hidden files, binary files, and files without crlf eol
find "$folders" -type f -print0 | xargs -0 dos2unix
# Find all non-hidden files in /etc that contain crlf eol
FILES=$(find /etc -type f -not -path '*/\.*' -exec grep -Il $'\r' {} \;)
# Loop through each file and apply dos2unix
for f in $FILES; do
# Check if the file is a text file
if file "$f" | grep -q text; then
# Apply dos2unix and keep the original timestamp
dos2unix -k "$f"
fi fi
done done