aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaria Lisina <sekoohaka.sarisan@gmail.com>2025-07-05 06:39:02 +0500
committerMaria Lisina <sekoohaka.sarisan@gmail.com>2025-07-05 06:39:02 +0500
commit274d5b3c55f37c0bc29579a8b1ae5a2bfc0de1be (patch)
treef3c4ba1b77812f0984818e6f594cd43c4d5585e8
parent67ec9adcaf09d47bf4d2db4087fe15b8ea460a03 (diff)
bot: Add check for files length
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
-rw-r--r--README.md1
-rwxr-xr-xbot.zsh10
2 files changed, 11 insertions, 0 deletions
diff --git a/README.md b/README.md
index e6d95f9..f5aaf49 100644
--- a/README.md
+++ b/README.md
@@ -50,6 +50,7 @@ For distribution specific installation commands follow [command-not-found](https
* sha1sum
* sleep
* tr
+* wc
## Deployment
diff --git a/bot.zsh b/bot.zsh
index ede6062..e0df300 100755
--- a/bot.zsh
+++ b/bot.zsh
@@ -59,6 +59,7 @@ busybox=(
sha1sum
sleep
tr
+ wc
)
if [[ -n "${1}" ]]
@@ -415,6 +416,15 @@ do
fi
done
+for file in donate help
+do
+ if [[ $(wc -m "${files}/${file}.txt" | parameter 1) -gt 4096 ]]
+ then
+ log_text="Error: File ${file}.txt is too large"
+ . "${units}/log.zsh"
+ fi
+done
+
if ! [[ -s "${files}/donate.txt" ]]
then
nocommand_donate=0