Skip to content

Commit

Permalink
api.stop.imapsync-all-tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Sep 28, 2023
1 parent d0d020a commit 4cd1aff
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions imageroot/actions/stop-imapsync-all-tasks/20stop-all-tasks
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env python3

#
# Copyright (C) 2023 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-3.0-or-later
#

import glob
import agent

for file in glob.iglob("imapsync/*.env"):
local_user = file.removeprefix('imapsync/').removesuffix('.env')
agent.run_helper("systemctl", "--user", "stop", "imapsync@"+local_user).check_returncode()

0 comments on commit 4cd1aff

Please sign in to comment.