Fix: Remove syntax error in I1 parameter and define I1_VAL variable#111
Open
incursion121985-ship-it wants to merge 1 commit into
Open
Fix: Remove syntax error in I1 parameter and define I1_VAL variable#111incursion121985-ship-it wants to merge 1 commit into
incursion121985-ship-it wants to merge 1 commit into
Conversation
## Описание проблемы
Скрипт содержал две критические ошибки, которые приводили к генерации некорректного конфига:
1. **Синтаксическая ошибка в параметре I1** — строка содержала `<b ` перед hex значением:
```
I1 = <b 0xc2000000...
```
Это делало конфиг невалидным для AmneziaVPN
2. **Переменная I1_VAL не определена** — при создании JSON объекта использовалась переменная `$I1_VAL`, которая никогда не инициализировалась, что приводило к пустому значению
## Решение
- Удалил синтаксическую ошибку `<b ` из значения I1
- Добавил строку для извлечения значения I1 из конфига перед использованием:
```bash
I1_VAL=$(echo "${conf}" | grep '^I1 = ' | sed 's/I1 = //')
```
## Результат
Конфиг теперь генерируется корректно и успешно импортируется в AmneziaVPN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The script generates invalid config with two critical errors:
Syntax error in I1 parameter: The line contains
<bprefix before hex value:This makes the config invalid for AmneziaVPN.
Undefined I1_VAL variable: The variable
$I1_VALis used when creating JSON but is never initialized, resulting in an empty value.Solution
<bfrom the I1 hex valueI1_VAL=$(echo "${conf}" | grep '^I1 = ' | sed 's/I1 = //')Result
Config now generates correctly with valid I1 parameter and can be successfully imported to AmneziaVPN.