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