mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 14:16:31 +00:00
/etc/init.d/base: small prepare_conf optimization
This commit is contained in:
parent
d907029ee4
commit
92bd4b031d
@ -39,6 +39,14 @@ prepare_conf() {
|
||||
|
||||
if [[ -n "$user_conf" && -e "$user_conf" ]]; then
|
||||
cp -rf "$user_conf" "$actual_conf"
|
||||
|
||||
# we want only Unix newlines in conf files
|
||||
if [[ -f "$actual_conf" ]]; then
|
||||
sed -i 's/\r//g' "$actual_conf"
|
||||
elif [[ -d "$actual_conf" ]]; then
|
||||
find "$actual_conf" -type f | xargs -L1 sed -i 's/\r//g'
|
||||
fi
|
||||
|
||||
grep -E "/boot .*ro[\s,]" /proc/mounts &>/dev/null
|
||||
RO=$?
|
||||
test $RO == 0 && mount -o remount,rw /boot
|
||||
@ -49,12 +57,5 @@ prepare_conf() {
|
||||
if [[ ! -e "$actual_conf" && -e "$system_conf" ]]; then
|
||||
cp "$system_conf" "$actual_conf"
|
||||
fi
|
||||
|
||||
# we want only Unix newlines in conf files
|
||||
if [[ -f "$actual_conf" ]]; then
|
||||
sed -i 's/\r//g' "$actual_conf"
|
||||
elif [[ -d "$actual_conf" ]]; then
|
||||
find "$actual_conf" -type f | xargs -L1 sed -i 's/\r//g'
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user