INNER CODE UNIT · Shell
config_repo_temp_dir
haugene/docker-transmission-openvpn · openvpn/fetch-external-configs.sh:32
config_repo_temp_dir=$(mktemp -d)
echo "Extracting configs to ${config_repo_temp_dir}"
unzip -q "${config_repo_temp_zip_file}" -d "${config_repo_temp_dir}"
# Find the specified provider folder. Should be under <tmpDir>/<some-root-folder>/openvpn/<provider>
provider_configs=$(find "${config_repo_temp_dir}"/*/openvpn -type d -name "${VPN_PROVIDER}")
if [[ -z "${provider_configs}" ]]; then
echo "ERROR: Could not find any configs for provider ${VPN_PROVIDER^^} in downloaded configs"
exit 1
fi
# Replace current provider home folder with the downloaded directory
echo "Found configs for ${VPN_PROVIDER^^} in ${provider_configs}, will replace current content in ${VPN_PROVIDER_HOME}"
rm -rf "${VPN_PROVIDER_HOME}"
mv "${provider_configs}" "${VPN_PROVIDER_HOME}"
exit 0