Skip to content

Commit

Permalink
qzeleza#234 не выводим сообщение о бекапе, если его не было
Browse files Browse the repository at this point in the history
  • Loading branch information
AltGrF13 authored and AltGrF13 committed Jan 16, 2025
1 parent 7552b6b commit 207715d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions opt/bin/main/setup
Original file line number Diff line number Diff line change
Expand Up @@ -337,17 +337,20 @@ list__backup() {
# -n не перезаписываем, если сегодняшний бекап уже есть
if grep -qF '*' "${source_file}" ; then
local backup1_file="${backup_path}1_${backup_filename}"
if [ -f "${backup1_file}" ] ; then
return
fi

echo "Резервная копия списка старого формата в ${backup1_file}"
cp -n "${source_file}" "${backup1_file}"
cp "${source_file}" "${backup1_file}"

if ! [ -f "${backup2_file}" ] ; then
echo "Преобразуем в новый формат в ${backup2_file}"
sed 's/\*\.//g;s/\*//g' "${source_file}" >"${backup2_file}"
fi
else
elif ! [ -f "${backup2_file}" ] ; then
echo "Резервная копия списка в ${backup2_file}"
cp -n "${source_file}" "${backup2_file}"
cp "${source_file}" "${backup2_file}"
fi
}

Expand Down

0 comments on commit 207715d

Please sign in to comment.