From db86b488fb3e0fdd9990a88778c68948ac7db112 Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Tue, 18 Apr 2023 01:50:44 +0700 Subject: [PATCH] remove rm --- vestasync.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/vestasync.py b/vestasync.py index be8b766..06e901b 100755 --- a/vestasync.py +++ b/vestasync.py @@ -102,9 +102,7 @@ def init_repo(c): def copy_wb_rule(c): - wb_rule_path = "/mnt/data/etc/wb-rules/vestasync.js" - c.run(f"rm {wb_rule_path} || true") - c.put("./files/vestasync.js", wb_rule_path) + c.put("./files/vestasync.js", "/mnt/data/etc/wb-rules/vestasync.js") def create_automac_systemd(c): #disable @@ -118,9 +116,7 @@ def create_automac_systemd(c): } for local_path, remote_path in file_paths.items(): - c.run(f"rm {remote_path} || true") c.put(local_path, remote_path) - c.run(f"chmod +x {remote_path}") #reload c.run("systemctl daemon-reload") @@ -157,9 +153,7 @@ def create_autogit_systemd(c): } for local_path, remote_path in file_paths.items(): - c.run(f"rm {remote_path} || true") c.put(local_path, remote_path) - c.run(f"chmod +x {remote_path}") #reload c.run("systemctl daemon-reload") @@ -232,8 +226,7 @@ def ppush_the_repo(c): def run_user_cmd(c, file): user_cmd_file = "/tmp/user_cmd.sh" c.put(file, user_cmd_file) - c.run(f"chmod +x {user_cmd_file}") - c.run(f"{user_cmd_file}") + c.run(f"bash {user_cmd_file}") c.run(f"rm {user_cmd_file}") def save_mac_in_cfg(c):