Merge pull request #14 from DyonR/dev

Fixed getting 'vpn_remote_line' for files configs without spaces
This commit is contained in:
DyonR 2020-09-12 22:52:07 +02:00 committed by GitHub
commit 7a2ba4df3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -117,7 +117,7 @@ if [[ $VPN_ENABLED == "yes" ]]; then
if [[ "${VPN_TYPE}" == "openvpn" ]]; then
export vpn_remote_line=$(cat "${VPN_CONFIG}" | grep -P -o -m 1 '(?<=^remote\s)[^\n\r]+' | sed -e 's~^[ \t]*~~;s~[ \t]*$~~')
else
export vpn_remote_line=$(cat "${VPN_CONFIG}" | grep -P -o -m 1 '(?<=^Endpoint\s)[^\n\r]+' | sed -e 's~^[=\ ]*~~')
export vpn_remote_line=$(cat "${VPN_CONFIG}" | grep -P -o -m 1 '(?<=^Endpoint)(\s{0,})[^\n\r]+' | sed -e 's~^[=\ ]*~~')
fi
if [[ ! -z "${vpn_remote_line}" ]]; then

View File

@ -6,10 +6,10 @@ fi
# Set the correct rights accordingly to the PUID and PGID on /config/qBittorrent
chown -R ${PUID}:${PGID} /config/qBittorrent
# Set the rights on the /blackhole folder
# Set the rights on the /downloads folder
chown -R ${PUID}:${PGID} /downloads
# Check if ServerConfig.json exists, if not, copy the template over
# Check if qBittorrent.conf exists, if not, copy the template over
if [ ! -e /config/qBittorrent/config/qBittorrent.conf ]; then
echo "[WARNING] qBittorrent.conf is missing, this is normal for the first launch! Copying template." | ts '%Y-%m-%d %H:%M:%.S'
cp /etc/qbittorrent/qBittorrent.conf /config/qBittorrent/config/qBittorrent.conf