mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-30 20:34:04 +02:00
Update 93-openvpn.sh
This commit is contained in:
@@ -35,7 +35,7 @@ if bashio::config.true 'openvpn_enabled'; then
|
|||||||
while read -r line
|
while read -r line
|
||||||
do
|
do
|
||||||
# Check if the line contains a txt file
|
# Check if the line contains a txt file
|
||||||
if [[ "$line" =~ \.txt ]] || [[ "$line" =~ \.crt ]] || [[ "$line" =~ auth-user-pass ]]; then
|
if [[ ! $line =~ ^"#" ]] && [[ ! $line =~ ^";" ]] && [[ "$line" =~ \.txt ]] || [[ "$line" =~ \.crt ]] || [[ "$line" =~ auth-user-pass ]]; then
|
||||||
# Extract the txt file name from the line
|
# Extract the txt file name from the line
|
||||||
file_name="$(echo "$line" | awk -F' ' '{print $2}')"
|
file_name="$(echo "$line" | awk -F' ' '{print $2}')"
|
||||||
# Check if the txt file exists
|
# Check if the txt file exists
|
||||||
@@ -136,7 +136,7 @@ if bashio::config.true 'openvpn_enabled'; then
|
|||||||
file_name="${file_name:-null}"
|
file_name="${file_name:-null}"
|
||||||
if grep -q ^auth-user-pass /config/openvpn/"$openvpn_config" ; then
|
if grep -q ^auth-user-pass /config/openvpn/"$openvpn_config" ; then
|
||||||
# Credentials specified are they custom ?
|
# Credentials specified are they custom ?
|
||||||
if [[ "$file_name" != *"/etc/openvpn/credentials"* ]]; then
|
if [[ "$file_name" != *"/etc/openvpn/credentials"* ]] && [[ "$file_name" != "null" ]]; then
|
||||||
if [ -f "$file_name" ]; then
|
if [ -f "$file_name" ]; then
|
||||||
# If credential specified, exists, and is not the addon default
|
# If credential specified, exists, and is not the addon default
|
||||||
bashio::log.warning "auth-user-pass specified in the ovpn file, addon username and passwords won't be used !"
|
bashio::log.warning "auth-user-pass specified in the ovpn file, addon username and passwords won't be used !"
|
||||||
|
|||||||
Reference in New Issue
Block a user