Skip to content

Commit a5725b2

Browse files
committed
.sh file still created when file didn't exsists
1 parent ee9aec6 commit a5725b2

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

bin/v-download-backup

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,23 +162,22 @@ if [ ! -e "$BACKUP/$backup" ]; then
162162
if [ -z "$downloaded" ]; then
163163
check_result $E_NOTEXIST "backup file $backup doesn't exist in '${BACKUP}' folder"
164164
else
165+
if [ -e "$BACKUP/$backup" ]; then
165166
chmod 0640 $BACKUP/$backup
166167
chown admin:admin $BACKUP/$backup
167-
fi
168-
fi
169-
170-
echo "
171-
#!/bin/bash
168+
echo "#!/bin/bash
172169
# Reset at timer every 15 min after 1st hour if the file is still downloading / Check if hestia-ng is still accessing $BACKUP/$backup
173170
174171
if lsof $BACKUP/$backup | grep hestia-ng; then
175-
at -f /$BACKUP/$backup.sh now + 15 minutes
172+
at -f /$BACKUP/$backup.sh now + 15 minutes
176173
else
177-
rm $BACKUP/$backup;
178-
rm $BACKUP/$backup.sh;
174+
rm $BACKUP/$backup;
175+
rm $BACKUP/$backup.sh;
179176
fi" > $BACKUP/$backup.sh;
180-
181-
at -f /$BACKUP/$backup.sh now + 60 minutes
177+
at -f /$BACKUP/$backup.sh now + 60 minutes
178+
fi
179+
fi
180+
fi
182181
#----------------------------------------------------------#
183182
# Hestia #
184183
#----------------------------------------------------------#

0 commit comments

Comments
 (0)