mirror of
https://github.com/anten-ka/gotelegram_pro.git
synced 2026-05-19 23:16:16 +00:00
bugfix: {{NC}} typo, bot TOML v3 parsing, add_secret v3 format
- install.sh: fix {{NC}} -> ${NC} color escape on line 265
- bot.py: fix TOML parsing for telemt v3 [access.users] format
- bot.py: fix telemt config section [server].port instead of [config].listen_port
- telemt_config.sh: fix add_secret_to_config() for v3 format
This commit is contained in:
@@ -81,13 +81,17 @@ add_secret_to_config() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Добавляем новый блок [[users]]
|
||||
cat >> "$config" << EOSECRET
|
||||
# telemt v3: добавляем ключ в секцию [access.users]
|
||||
# Формат: name = "secret" под блоком [access.users]
|
||||
if grep -q '\[access\.users\]' "$config"; then
|
||||
sed -i "/\[access\.users\]/a ${name} = \"${secret}\"" "$config"
|
||||
else
|
||||
cat >> "$config" << EOSECRET
|
||||
|
||||
[[users]]
|
||||
name = "${name}"
|
||||
secret = "${secret}"
|
||||
[access.users]
|
||||
${name} = "${secret}"
|
||||
EOSECRET
|
||||
fi
|
||||
|
||||
log_success "Добавлен секрет: $name"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user