mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-30 02:24:14 +02:00
Enhance OpenVPN logging and verbosity settings
https://github.com/alexbelgium/hassio-addons/issues/2611 @litinoveweedle
This commit is contained in:
@@ -499,15 +499,23 @@ _openvpn_up() {
|
||||
chmod 755 ${config["PostDownScript"]}
|
||||
|
||||
# Define logging
|
||||
log_path="/dev/null"
|
||||
[[ "$log_level" == "debug" ]] && log_path="/proc/1/fd/1"
|
||||
declare -A verbosity=(
|
||||
["fatal"]=1
|
||||
["error"]=1
|
||||
["warning"]=2
|
||||
["notice"]=3
|
||||
["info"]=4
|
||||
["debug"]=5
|
||||
["trace"]=6
|
||||
)
|
||||
|
||||
# Start OpenVPN in the background
|
||||
_cmd "/usr/sbin/openvpn \
|
||||
--config "${config["ConfigFile"]}" \
|
||||
--client \
|
||||
--daemon \
|
||||
--log "$log_path" \
|
||||
--verb ${verbosity[${$log_level}]} \
|
||||
--log "/proc/1/fd/1" \
|
||||
--script-security 2 \
|
||||
--auth-user-pass "${OPENVPN_STATE_DIR}/credentials.conf" \
|
||||
--auth-retry none \
|
||||
|
||||
Reference in New Issue
Block a user