mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-28 08:50:32 +02:00
Github bot : script beautyshied
This commit is contained in:
@@ -25,12 +25,12 @@ if bashio::config.true 'openvpn_enabled'; then
|
|||||||
# Function to check for files path
|
# Function to check for files path
|
||||||
function check_path () {
|
function check_path () {
|
||||||
|
|
||||||
# Get variable
|
# Get variable
|
||||||
file="$1"
|
file="$1"
|
||||||
|
|
||||||
# Loop through each line of the input file
|
# Loop through each line of the input file
|
||||||
while read line
|
while read line
|
||||||
do
|
do
|
||||||
# Check if the line contains a txt file
|
# Check if the line contains a txt file
|
||||||
if [[ "$line" =~ \.txt ]] || [[ "$line" =~ \.crt ]]; then
|
if [[ "$line" =~ \.txt ]] || [[ "$line" =~ \.crt ]]; then
|
||||||
# Extract the txt file name from the line
|
# Extract the txt file name from the line
|
||||||
@@ -49,10 +49,10 @@ do
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done < "$file"
|
done < "$file"
|
||||||
|
|
||||||
# Standardize lf
|
# Standardize lf
|
||||||
dos2unix "$file"
|
dos2unix "$file"
|
||||||
|
|
||||||
|
|
||||||
# Correct paths
|
# Correct paths
|
||||||
@@ -76,7 +76,7 @@ dos2unix "$file"
|
|||||||
check_path /config/openvpn/"$openvpn_config"
|
check_path /config/openvpn/"$openvpn_config"
|
||||||
# Copy potential additional files
|
# Copy potential additional files
|
||||||
cp /config/openvpn/* /etc/openvpn/
|
cp /config/openvpn/* /etc/openvpn/
|
||||||
# Standardize file
|
# Standardize file
|
||||||
cp /config/openvpn/"${openvpn_config}" /etc/openvpn/config.ovpn
|
cp /config/openvpn/"${openvpn_config}" /etc/openvpn/config.ovpn
|
||||||
# Not correct type
|
# Not correct type
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user