diff options
author | u <u@billy> | 2023-04-09 10:46:54 -0400 |
---|---|---|
committer | u <u@billy> | 2023-04-09 10:46:54 -0400 |
commit | 1e9cb44dc75c6edc83703bb93ca6946368c0fbec (patch) | |
tree | b7a3bedf7fbf3255d27cef5c5f1ab6b8ad9f480b | |
parent | e0a8c461c7a8417a0de66a2b2a6579cccd02d1e3 (diff) |
"go.sh install" will stop existing service and replace it
-rwxr-xr-x | go.sh | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -10,6 +10,10 @@ CMD=$0 | |||
10 | 10 | ||
11 | self_install() | 11 | self_install() |
12 | { | 12 | { |
13 | if systemctl --user is-active "$UNIT" >/dev/null | ||
14 | then | ||
15 | systemctl --user stop "$UNIT" | ||
16 | fi | ||
13 | systemctl --user reset-failed "$UNIT" 2>/dev/null | 17 | systemctl --user reset-failed "$UNIT" 2>/dev/null |
14 | systemd-run --user \ | 18 | systemd-run --user \ |
15 | --unit "$UNIT" \ | 19 | --unit "$UNIT" \ |