Skip to content

Commit

Permalink
Fail loudly when unable to retrieve the ovpn files
Browse files Browse the repository at this point in the history
  • Loading branch information
pschmitt committed Sep 1, 2015
1 parent 92e5bc2 commit ce81ed5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pia-tools
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,16 @@ update_config() {
echo -n 'Updating configuration... '
local ovpn ovpn_spaceless overwrite=$([[ -n "$FORCE" ]] && echo '-o')

# Fetch server config files
curl -sL -o "$PIA_CONFIG_DIR/openvpn.zip" "$PIA_CONFIG_URL" || {
echo 'Could not download openvpn config files'
exit 4
}

# Clean up
rm -f "$PIA_CONFIG_DIR/ca.crt" "$PIA_CONFIG_DIR"/*.ovpn

# Fetch server config files
curl -sL -o "$PIA_CONFIG_DIR/openvpn.zip" "$PIA_CONFIG_URL"
# Extract config files
unzip "$overwrite" -d "$PIA_CONFIG_DIR" -q "$PIA_CONFIG_DIR/openvpn.zip"

# Replace space by underscore in filenames
Expand Down

0 comments on commit ce81ed5

Please sign in to comment.