summaryrefslogtreecommitdiff
path: root/archive-dl
blob: 3a80ca5470546b77cde69e3738cc305464b1233d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh 

input=$1 
type=$2

# This is a function:
# It checks if the user has input data.
check() {
if [ -n "$1" ]; then
    echo 
else
    echo "Please enter URL/File type."; 
    exit 0
fi
}

check $input
check $type

curl -s $input | grep $type | sed -n 's/.*href="\([^"]*\)".*/\1/p' | xargs -I {} curl -LO "$input/{}"