feat(proxy-client): добавлены профили и системная служба
Добавлены независимые пользовательские профили, их выбор в Bash-командах и явная установка службы systemd. Инструкции размещены в README пакета. Проверка: 67 тестов на Python 3.8 и 3.14, shell-наборы и интеграция Bash с CLI. Загрузка ОС и восстановление настоящей службы требуют отдельной проверки.
This commit is contained in:
1 parent
b36ce50e12
commit
b34eb6ac4c
9 files changed
+835
-23
No files matched your search
@@ -32,8 +32,12 @@ _proxy_apply_env() {
|
||||
}
|
||||
|
||||
proxy_on() {
|
||||
if (( $# != 0 )) && { (( $# != 2 )) || [[ "$1" != --profile || -z "${2:-}" ]]; }; then
|
||||
echo "Использование: proxy_on [--profile NAME]" >&2
|
||||
return 2
|
||||
fi
|
||||
local output
|
||||
if ! output="$(_proxy_cli env)" || ! _proxy_apply_env "$output"; then
|
||||
if ! output="$(_proxy_cli "$@" env)" || ! _proxy_apply_env "$output"; then
|
||||
echo "Ошибка: прокси не включён" >&2
|
||||
return 1
|
||||
fi
|
||||
@@ -53,7 +57,16 @@ _proxy_run() {
|
||||
return 2
|
||||
fi
|
||||
shift
|
||||
_proxy_cli run -- "$command_name" "$@"
|
||||
local -a profile_args=()
|
||||
if [[ "${1:-}" == --proxy-profile ]]; then
|
||||
if (( $# < 2 )) || [[ -z "$2" ]]; then
|
||||
echo "Ошибка: --proxy-profile требует имя профиля" >&2
|
||||
return 2
|
||||
fi
|
||||
profile_args=(--profile "$2")
|
||||
shift 2
|
||||
fi
|
||||
_proxy_cli "${profile_args[@]}" run -- "$command_name" "$@"
|
||||
}
|
||||
|
||||
pclaude() { _proxy_run claude "$@"; }
|
||||
|
||||
Reference in new issue
Block a user