File: fetch.sh

package info (click to toggle)
psi 1.5%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 14,888 kB
  • sloc: cpp: 156,588; ansic: 15,068; javascript: 13,441; xml: 3,199; sh: 1,038; objc: 407; makefile: 396; python: 196; ruby: 171
file content (21 lines) | stat: -rwxr-xr-x 310 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

if [ $# != 2 ]; then
	echo "usage: $0 [url] [file]"
	exit 1
fi

WGET=`which wget`
if [ ! -z "$WGET" ]; then
	echo $WGET -O $2 $1
	$WGET -O $2 $1
else
	CURL=`which curl`
	if [ ! -z "$CURL" ]; then
		echo $CURL -o $2 $1
		$CURL -o $2 $1
	else
		echo "error: need wget or curl in path"
		exit 1
	fi
fi