diff options
| author | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2025-06-07 08:52:22 +0500 |
|---|---|---|
| committer | Maria Lisina <sekoohaka.sarisan@gmail.com> | 2025-06-07 08:52:22 +0500 |
| commit | 697d1f32c9947890adc0a2329c02035682575da0 (patch) | |
| tree | 8ec2c2ac8fd28074b2d0d9bc08a4990b3d9170e6 | |
| parent | 5058c7502129806ec3b3731974db811521d1c545 (diff) | |
bot: Nuke environment by default
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
| -rw-r--r-- | README.md | 3 | ||||
| -rwxr-xr-x | bot.zsh | 9 |
2 files changed, 9 insertions, 3 deletions
@@ -53,7 +53,8 @@ For distribution specific installation commands follow [command-not-found](https ## Deployment -It is highly recommended to run it with an empty environment to avoid variable conflict: `env -i ./bot.zsh` or `env -i PATH="${PATH}" ./bot.zsh` for Termux. +Usage: `./bot.zsh [options] [token]` + For better performance, it is recommended to use a locally deployed [Telegram Bot API](https://github.com/tdlib/telegram-bot-api) server. ### Available options @@ -3,8 +3,13 @@ # Copyright (C) 2024-2025 Maria Lisina # Copyright (C) 2024-2025 Danil Lisin # SPDX-License-Identifier: Apache-2.0 -# -# Run this software with `env -i` to avoid variable conflict + +if [[ ${__bot_noenv:-0} -eq 0 ]] +then + trap 'wait && exit 0' INT TERM + env -i PATH="${PATH}" __bot_noenv=1 "${0}" ${@} + exit ${?} +fi set -e umask 77 |
