diff --git a/modules/backups.py b/modules/backups.py index 0458c298..8ea0b2fa 100644 --- a/modules/backups.py +++ b/modules/backups.py @@ -56,8 +56,8 @@ def run_restore_backup(args): return run_as_root(["bash", restore_script_path] + args) def restore_backup(self, args): - if len(args) == 0 or len(args) > 2: - color_print("{red}Bad args. Usage:{endc} restore_backup [-y]") + if len(args) == 0 or len(args) > 3: + color_print("{red}Bad args. Usage:{endc} restore_backup [-y] [--skip-create-backup]") return if '-y' not in args: res = input( @@ -67,11 +67,14 @@ def restore_backup(self, args): return else: args.pop(args.index('-y')) - print('Before proceeding, mtc will create a backup of current configuration.') - try: - self.create_backup([]) - except: - color_print("{red}Could not create backup{endc}") + if '--skip-create-backup' in args: + args.pop(args.index('--skip-create-backup')) + else: + print('Before proceeding, mtc will create a backup of current configuration.') + try: + self.create_backup([]) + except: + color_print("{red}Could not create backup{endc}") ip = str(ip2int(get_own_ip())) command_args = ["-m", self.ton.local.buffer.my_work_dir, "-n", args[0], "-i", ip]