Skip to content

Commit 5837b57

Browse files
committed
raise error if old backup
1 parent f551af2 commit 5837b57

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

mytonctrl/scripts/restore_backup.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ rm -rf $tmp_dir
2929
mkdir $tmp_dir
3030
tar -xvzf $name -C $tmp_dir
3131

32+
if [ ! -d ${tmp_dir}/db ]; then
33+
echo "Error: db/ directory not found in archive. Aborting"
34+
35+
systemctl start validator
36+
systemctl start mytoncore
37+
38+
exit 1
39+
fi
40+
3241
rm -rf /var/ton-work/db/keyring
3342
cp -rf ${tmp_dir}/db /var/ton-work
3443
cp -rf ${tmp_dir}/keys /var/ton-work

0 commit comments

Comments
 (0)