mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-16 09:28:20 +01:00
Update 93-openvpn.sh
This commit is contained in:
@@ -56,9 +56,13 @@ if bashio::config.true 'openvpn_enabled'; then
|
||||
|
||||
# Check if the line contains a txt file
|
||||
#######################################
|
||||
if [[ ! $line =~ ^"#" ]] && [[ ! $line =~ ^";" ]] && [[ "$line" == *" "*"."* ]] || [[ "$line" == "auth-user-pass"* ]]; then
|
||||
if [[ ! $line =~ ^"#" ]] && [[ ! $line =~ ^";" ]] && [[ "$line" =~ *" "*"."[a-z]* ]] || [[ "$line" == "auth-user-pass"* ]]; then
|
||||
# Extract the txt file name from the line
|
||||
file_name="$(echo "$line" | awk -F' ' '{print $2}')"
|
||||
# if contains only numbers and dots it is likely an ip, don't check it
|
||||
if [[ "$file_name" =~ ^[0-9\.]+$ ]]; then
|
||||
continue
|
||||
fi
|
||||
# Check if the txt file exists
|
||||
if [[ "$file_name" != *"/etc/openvpn/credentials"* ]] && [ ! -f "$file_name" ]; then
|
||||
# Check if the txt file exists in the /config/openvpn/ directory
|
||||
|
||||
Reference in New Issue
Block a user