Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add languaje (ES) and update languaje (EN) for BE7000 #36

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
venv/
__pycache__/
xmir_base/__pycache__/
data/
data/*.lmo
tmp/
outdir/
config.txt
Expand Down
31 changes: 27 additions & 4 deletions create_backup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import datetime
import os
import sys

Expand All @@ -17,13 +18,37 @@
dev.get_part_table()
if not dev.partlist or len(dev.partlist) <= 1:
die("Partition list is empty!")

sn = gw.device_info.get('id', None)

print("device_name =", gw.device_name)
print("rom_version = {} {}".format(gw.rom_version, gw.rom_channel))
print("SN = {}".format(sn))
print("----------------------------------")

# Verificar que el modelo esté disponible
if not gw.device_name:
die("Could not get the router model.")

if not sn:
die("Could not obtain the serial number (SN) of the router.")


if gw.device_name and sn:
router_model = ''.join(e for e in gw.device_name if e.isalnum())
sn_sanitized = sn.replace('/', '_')
fn_dir = f'backups/{router_model}/{sn_sanitized}/'
else:
# Si no hay modelo o SN, usa la fecha actual
current_date = datetime.now().strftime("%Y%m%d_%H%M%S")
fn_dir = f'backups/{current_date}/'

fn_dir = 'backups/'
fn_old = fn_dir + 'full_dump.old'
fn_local = fn_dir + 'full_dump.bin'
fn_remote = '/tmp/mtd_dump.bin'
a_part = None
pid = None

if len(sys.argv) > 1:
for p, part in enumerate(dev.partlist):
print(' %2d > addr: 0x%08X size: 0x%08X name: "%s"' % (p, part['addr'], part['size'], part['name']))
Expand Down Expand Up @@ -110,6 +135,4 @@
if ret:
print('Backup of "{}" saved to file "./{}"'.format(name, fn_local))
print(" ")
print("Completed!")


print("Completed!")
Loading