make sure the file exist before messing with it

This commit is contained in:
Yves-Alexis Perez
2008-12-06 13:56:47 +00:00
parent c7deeb7d50
commit 78530d92b6
+2
View File
@@ -44,6 +44,7 @@ case "$1" in
if [ -h /etc/splashy/themes ]; then
# symlink
for FILE in ${FILES}; do
[ -f $FILE ] || break
if ! same_conffile "${THEME_FOLDER}/${FILE}"; then
# symlink and changed file, copy it in a safe place
[ -d $THEME_FOLDER_BAK ] || mkdir -p $THEME_FOLDER_BAK
@@ -53,6 +54,7 @@ case "$1" in
else
# real folder
for FILE in ${FILES}; do
[ -f $FILE ] || break
if ! same_conffile "${THEME_FOLDER}/${FILE}"; then
# real folder and changed file, move it in a safe place
[ -d $THEME_FOLDER_BAK ] || mkdir -p $THEME_FOLDER_BAK