Cleaner code

This commit is contained in:
Alexandre
2022-05-06 19:42:17 +02:00
committed by GitHub
parent ced75756c4
commit 465668b54d

View File

@@ -12,6 +12,9 @@ if bashio::config.true 'openvpn_enabled'; then
bashio::log.info "Configuring openvpn" bashio::log.info "Configuring openvpn"
# Get current ip
curl -s ipecho.net/plain > /currentip
##################### #####################
# CONFIGURE OPENVPN # # CONFIGURE OPENVPN #
##################### #####################
@@ -56,9 +59,6 @@ if bashio::config.true 'openvpn_enabled'; then
sed -i '/route-nopull/d' /etc/openvpn/config.ovpn sed -i '/route-nopull/d' /etc/openvpn/config.ovpn
fi fi
# Get current ip
echo "$(curl -s ipecho.net/plain)" > /currentip
# Exit # Exit
exit 0 exit 0
fi fi
@@ -74,9 +74,6 @@ if bashio::config.true 'openvpn_enabled'; then
LINE=$((LINE + 1)) LINE=$((LINE + 1))
SESSION=$(sed -n '/BitTorrent/=' "$QBT_CONFIG_FILE") SESSION=$(sed -n '/BitTorrent/=' "$QBT_CONFIG_FILE")
# Get current ip
echo "$(curl -s ipecho.net/plain)" > /currentip2
# If qBittorrent.conf exists # If qBittorrent.conf exists
if [ -f "$QBT_CONFIG_FILE" ]; then if [ -f "$QBT_CONFIG_FILE" ]; then
# Remove previous line and bind tun0 # Remove previous line and bind tun0