mirror of
https://github.com/vvzvlad/vestasync.git
synced 2024-11-05 14:59:12 +03:00
Compare commits
No commits in common. "e898e4e21e0fe0f29811416c29ff91bba7813172" and "99d83216bad17ef36384d0a99b2879a2a31d3600" have entirely different histories.
e898e4e21e
...
99d83216ba
11
vestasync.py
11
vestasync.py
@ -200,11 +200,10 @@ def mark_original_restored(c, mark):
|
|||||||
def reboot(c):
|
def reboot(c):
|
||||||
c.run("reboot > /dev/null 2>&1", warn=True)
|
c.run("reboot > /dev/null 2>&1", warn=True)
|
||||||
|
|
||||||
def git_remove_remote(c):
|
def git_add_remote(c):
|
||||||
hostname = c.run('hostname', hide=True).stdout.strip()
|
hostname = c.run('hostname', hide=True).stdout.strip()
|
||||||
c.run(f'cd /mnt/data/etc/ && git remote | xargs -L1 git remote remove', warn=True, hide=True)
|
c.run(f'cd /mnt/data/etc/ && git remote | xargs -L1 git remote remove', warn=True, hide=True)
|
||||||
|
|
||||||
|
|
||||||
def git_clone(c):
|
def git_clone(c):
|
||||||
c.run(f'rm -rf /mnt/data/{args.source_hostname}_etc ', warn=True)
|
c.run(f'rm -rf /mnt/data/{args.source_hostname}_etc ', warn=True)
|
||||||
c.run(f'mkdir -p /mnt/data/{args.source_hostname}_etc ', hide=True)
|
c.run(f'mkdir -p /mnt/data/{args.source_hostname}_etc ', hide=True)
|
||||||
@ -230,7 +229,7 @@ def copy_etc(c):
|
|||||||
c.run(f"mkdir -p {dest_item}")
|
c.run(f"mkdir -p {dest_item}")
|
||||||
print(f"Restore: {item} -> {dest_item}")
|
print(f"Restore: {item} -> {dest_item}")
|
||||||
|
|
||||||
print(f"[VestaSync] Copy source .git...")
|
print(f"[VestaSync] Сopy source .git...")
|
||||||
c.run(f"cp -R /mnt/data/{args.source_hostname}_etc/.git /mnt/data/etc/.git")
|
c.run(f"cp -R /mnt/data/{args.source_hostname}_etc/.git /mnt/data/etc/.git")
|
||||||
|
|
||||||
print(f"[VestaSync] Remove source etc...")
|
print(f"[VestaSync] Remove source etc...")
|
||||||
@ -305,11 +304,12 @@ def device_install(c):
|
|||||||
print("[VestaSync] Run users cmd's...")
|
print("[VestaSync] Run users cmd's...")
|
||||||
run_user_cmd(c, args.user_cmd)
|
run_user_cmd(c, args.user_cmd)
|
||||||
|
|
||||||
print("[VestaSync] Initializing local repo and add remote...")
|
print("[VestaSync] Initializing local repo...")
|
||||||
init_repo(c)
|
init_repo(c)
|
||||||
|
|
||||||
print("[VestaSync] Creating repo on gitea...")
|
print("[VestaSync] Creating repo on gitea and add remote...")
|
||||||
create_repo(c)
|
create_repo(c)
|
||||||
|
git_add_remote(c)
|
||||||
|
|
||||||
print("[VestaSync] Pushing raw cfg's...")
|
print("[VestaSync] Pushing raw cfg's...")
|
||||||
ppush_the_repo(c)
|
ppush_the_repo(c)
|
||||||
@ -365,6 +365,7 @@ def device_restore():
|
|||||||
restore_hostname(c)
|
restore_hostname(c)
|
||||||
if args.reinstall_packages is not None:
|
if args.reinstall_packages is not None:
|
||||||
install_packages(c)
|
install_packages(c)
|
||||||
|
git_add_remote(c)
|
||||||
#ppush_the_repo(c) #TODO: не работает!
|
#ppush_the_repo(c) #TODO: не работает!
|
||||||
create_autogit_systemd(c)
|
create_autogit_systemd(c)
|
||||||
create_automac_systemd(c)
|
create_automac_systemd(c)
|
||||||
|
Loading…
Reference in New Issue
Block a user