mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-03 16:00:29 +01:00
Create 21-openvpn
This commit is contained in:
23
qbittorrent/rootfs/etc/cont-init.d/21-openvpn
Normal file
23
qbittorrent/rootfs/etc/cont-init.d/21-openvpn
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
|
||||
declare openvpn_config
|
||||
declare openvpn_username
|
||||
declare openvpn_password
|
||||
|
||||
if bashio::config.true 'openvpn_enabled'; then
|
||||
|
||||
openvpn_config=$(bashio::config 'openvpn_config')
|
||||
|
||||
cp "/config/openvpn/${openvpn_config}.ovpn" /etc/openvpn/config.ovpn
|
||||
|
||||
openvpn_username=$(bashio::config 'openvpn_username')
|
||||
echo "${openvpn_username}" > /etc/openvpn/credentials
|
||||
openvpn_password=$(bashio::config 'openvpn_password')
|
||||
echo "${openvpn_password}" >> /etc/openvpn/credentials
|
||||
|
||||
sed -i 's/auth-user-pass.*/auth-user-pass \/etc\/openvpn\/credentials/g' /etc/openvpn/config.ovpn
|
||||
|
||||
sed -i "1a\/etc/openvpn/up-qbittorrent.sh \"\${4}\" &\n" /etc/openvpn/up.sh
|
||||
|
||||
fi
|
||||
Reference in New Issue
Block a user