mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-26 10:33:40 +02:00
Merge pull request #2630 from alexbelgium/copilot/fix-openvpn-connection-issue-again
Fix OpenVPN AUTH_FAILED: credential file corruption and config cleanup
This commit is contained in:
@@ -113,7 +113,7 @@ RUN chmod 744 /ha_automodules.sh && /ha_automodules.sh "$MODULES" && rm /ha_auto
|
|||||||
# && chmod a+x /etc/s6-overlay/s6-rc.d/$SCRIPTSNAME/* ; done; fi
|
# && chmod a+x /etc/s6-overlay/s6-rc.d/$SCRIPTSNAME/* ; done; fi
|
||||||
|
|
||||||
# Manual apps
|
# Manual apps
|
||||||
ARG PACKAGES="ipcalc wireguard-tools libnatpmp iptables ip6tables"
|
ARG PACKAGES="openvpn ipcalc wireguard-tools libnatpmp iptables ip6tables"
|
||||||
|
|
||||||
# Automatic apps & bashio
|
# Automatic apps & bashio
|
||||||
COPY ha_autoapps.sh /ha_autoapps.sh
|
COPY ha_autoapps.sh /ha_autoapps.sh
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ else
|
|||||||
bashio::addon.stop
|
bashio::addon.stop
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${openvpn_username}\n${openvpn_password}" > "${OPENVPN_STATE_DIR}/credentials.conf"
|
printf '%s\n%s\n' "${openvpn_username}" "${openvpn_password}" > "${OPENVPN_STATE_DIR}/credentials.conf"
|
||||||
chmod 600 "${OPENVPN_STATE_DIR}/credentials.conf"
|
chmod 600 "${OPENVPN_STATE_DIR}/credentials.conf"
|
||||||
|
|
||||||
if bashio::config.has_value "openvpn_config"; then
|
if bashio::config.has_value "openvpn_config"; then
|
||||||
@@ -99,7 +99,7 @@ sed -i '/^[[:blank:]]*$/d' "${openvpn_runtime_config}"
|
|||||||
sed -i '/^up/d' "${openvpn_runtime_config}"
|
sed -i '/^up/d' "${openvpn_runtime_config}"
|
||||||
sed -i '/^down/d' "${openvpn_runtime_config}"
|
sed -i '/^down/d' "${openvpn_runtime_config}"
|
||||||
sed -i '/^route/d' "${openvpn_runtime_config}"
|
sed -i '/^route/d' "${openvpn_runtime_config}"
|
||||||
sed -i '/^auth-user-pass /d' "${openvpn_runtime_config}"
|
sed -i '/^auth-user-pass/d' "${openvpn_runtime_config}"
|
||||||
sed -i '/^cd /d' "${openvpn_runtime_config}"
|
sed -i '/^cd /d' "${openvpn_runtime_config}"
|
||||||
sed -i '/^chroot /d' "${openvpn_runtime_config}"
|
sed -i '/^chroot /d' "${openvpn_runtime_config}"
|
||||||
sed -i '$q' "${openvpn_runtime_config}"
|
sed -i '$q' "${openvpn_runtime_config}"
|
||||||
|
|||||||
Reference in New Issue
Block a user