forked from Montana/curl-fetch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcurl_fetch.sh
44 lines (38 loc) · 915 Bytes
/
curl_fetch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Set the URL for downloading curl
CURL_URL="http://curl.haxx.se/download/curl-7.79.0.tar.bz2"
CURL_TARBALL="curl.tar.bz2"
# Use wget to download curl
echo "Downloading curl..."
if wget "${CURL_URL}" -O "${CURL_TARBALL}"; then
echo "Download complete."
else
echo "Error downloading curl."
exit 1
fi
# Extract the downloaded file
echo "Extracting..."
if tar -xjf "${CURL_TARBALL}"; then
echo "Extraction complete."
else
echo "Error extracting curl."
exit 1
fi
# Navigate into the extracted directory
cd curl-7.79.0 || exit
# Configure curl
echo "Configuring..."
if ./configure --without-ssl; then
echo "Configuration complete."
else
echo "Error in configuration."
exit 1
fi
# Build and install curl
echo "Installing curl..."
if make && sudo make install; then
echo "curl has been installed successfully."
else
echo "Error installing curl."
exit 1
fi