aboutsummaryrefslogtreecommitdiff
path: root/operators/command_stop.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'operators/command_stop.zsh')
-rw-r--r--operators/command_stop.zsh24
1 files changed, 24 insertions, 0 deletions
diff --git a/operators/command_stop.zsh b/operators/command_stop.zsh
new file mode 100644
index 0000000..1ddf10c
--- /dev/null
+++ b/operators/command_stop.zsh
@@ -0,0 +1,24 @@
+# Copyright (C) 2024-2026 Maria Lisina
+# Copyright (C) 2024-2026 Danil Lisin
+# SPDX-License-Identifier: Apache-2.0
+
+if [[ "${chat_id}" != "${target_user}" ]]
+then
+ output_text="For security reasons you can execute this command only in direct messages"
+ return
+fi
+
+for lock in ${user_locks[@]}
+do
+ until mkdir "${user_config}_${lock}.lock"
+ do
+ sleep 1
+ done
+done
+
+source "${units}/stop.zsh"
+
+for lock in ${user_locks[@]}
+do
+ rmdir "${user_config}_${lock}.lock"
+done