diff options
| author | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2025-05-19 18:01:39 +0500 |
|---|---|---|
| committer | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2025-05-19 18:01:39 +0500 |
| commit | 03a7c5b049ff7ba50330c77452575133f84e386e (patch) | |
| tree | f79ff366d099de59631e9936ee58f01a482f08e6 /units/user.zsh | |
| parent | 0ff0b7f0e6b99aedc52c031e476ec85cb6702c97 (diff) | |
bot: Begin porting to Z Shell
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
Diffstat (limited to 'units/user.zsh')
| -rw-r--r-- | units/user.zsh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/units/user.zsh b/units/user.zsh new file mode 100644 index 0000000..f861301 --- /dev/null +++ b/units/user.zsh @@ -0,0 +1,24 @@ +# Copyright (C) 2024-2025 Maria Lisina +# Copyright (C) 2024-2025 Danil Lisin +# SPDX-License-Identifier: Apache-2.0 + +aliases_file="${files}/aliases.txt" +blacklist_file="${files}/blacklist.txt" +whitelist_file="${files}/whitelist.txt" + +if [[ -s "${aliases_file}" ]] && alias="$(grep -x "${user_id} .*" "${aliases_file}")" +then + user_id="$(printf "%s" "${alias}" | parameter 2)" +fi + +if [[ -s "${blacklist_file}" ]] && grep -qx "${user_id}" "${blacklist_file}" +then + exit 0 +fi + +if [[ -s "${whitelist_file}" ]] && ! grep -qx "${user_id}" "${whitelist_file}" +then + exit 0 +fi + +user_config="${config}/${user_id}" |
