From 68ca645a81215a9e0d8a1177dbd7da8bd383c415 Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Sun, 16 Apr 2023 23:03:20 +0700 Subject: [PATCH] small update --- vestasync.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/vestasync.py b/vestasync.py index d9643d4..ca6f3d7 100755 --- a/vestasync.py +++ b/vestasync.py @@ -93,8 +93,8 @@ def create_repo(c): def init_repo(c): hostname = c.run('hostname', hide=True).stdout.strip() - #c.run('cd /mnt/data/etc/ && git init') - #c.run(f'cd /mnt/data/etc/ && git remote add origin {args.vestasync_gitea_protocol}://{gitea_user}:{args.gitea_token}@{args.vestasync_gitea_host}:{args.vestasync_gitea_port}/{gitea_user}/{hostname}.git') + c.run('cd /mnt/data/etc/ && git init') + c.run(f'cd /mnt/data/etc/ && git remote add origin {args.vestasync_gitea_protocol}://{gitea_user}:{args.gitea_token}@{args.vestasync_gitea_host}:{args.vestasync_gitea_port}/{gitea_user}/{hostname}.git') def create_automac_systemd(c): @@ -190,22 +190,21 @@ def save_mac_in_cfg(c): def device_install(): - with Connection(host=args.device_ip, user=device_user) as c: - #prepare_packages_wb(c) - #configure_git(c) - #get_short_sn(c) - #set_hostname(c) - #create_repo(c) - #init_repo(c) - #create_autogit_systemd(c) - #ppush_the_repo(c) + with Connection(host=args.device_ip, user=device_user, connect_kwargs={"password": "wirenboard"}) as c: + prepare_packages_wb(c) + configure_git(c) + get_short_sn(c) + set_hostname(c) + create_repo(c) + init_repo(c) + ppush_the_repo(c) save_mac_in_cfg(c) save_hostname(c) ppush_the_repo(c) - -def device_update(): - with Connection(host=args.device_ip, user=device_user) as c: - ppush_the_repo(c) + create_automac_systemd(c) + create_autogit_systemd(c) + run_user_cmd(c) + reboot(c) def device_restore(): with Connection(host=args.device_ip, user=device_user) as c: @@ -213,9 +212,11 @@ def device_restore(): #configure_git(c) #git_clone(c) #copy_etc(c) - #ppush_the_repo(c) #restore_hostname(c) + #ppush_the_repo(c) + create_autogit_systemd(c) + create_automac_systemd(c) if __name__ == '__main__':