Commit c8e6ee26 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

bugfix: unpacking backup

parent 438d8224
...@@ -202,6 +202,7 @@ function copy_backup(){ ...@@ -202,6 +202,7 @@ function copy_backup(){
if (is_dir("$UBI_MNT${BKP_DIR}_defaults")) rmdir("$UBI_MNT${BKP_DIR}_defaults"); if (is_dir("$UBI_MNT${BKP_DIR}_defaults")) rmdir("$UBI_MNT${BKP_DIR}_defaults");
rename("$UBI_MNT${BKP_DIR}","$UBI_MNT${BKP_DIR}_defaults"); rename("$UBI_MNT${BKP_DIR}","$UBI_MNT${BKP_DIR}_defaults");
//restore old configs //restore old configs
exec("mkdir -p ${UBI_MNT}${BKP_DIR}");
exec("tar -C ${UBI_MNT}${BKP_DIR} -xzpf var/$BKP_NAME"); exec("tar -C ${UBI_MNT}${BKP_DIR} -xzpf var/$BKP_NAME");
}else{ }else{
exec("cp -r $UBI_MNT${BKP_DIR} $UBI_MNT${BKP_DIR}_defaults"); exec("cp -r $UBI_MNT${BKP_DIR} $UBI_MNT${BKP_DIR}_defaults");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment