Add .gitignore file
[s390-tools.git] / zfcpdump / get_files.sh
blob71442a3ecdb820967ed8690de572be2544a8d5af
1 #!/bin/sh
3 # Shell script to get the required tarballs for zfcpdump from the internet
4 #
5 # > get_files : get files from internet
6 # > get_files -c: check if all files are already there
8 # Copyright IBM Corp. 2003, 2006.
9 # Author(s): Michael Holzheu <holzheu@de.ibm.com>
12 . ./config
15 # check(): function to check error codes
17 function check ()
19 if [ $? != 0 ]
20 then
21 echo "failed"
22 exit 1
23 else
24 echo "ok"
29 # get_files(): get files from the internet
31 function get_files()
33 if [ "${WGET_PROXY}" != "" ]
34 then
35 export http_proxy=$WGET_PROXY
38 if [ ! -f "extern/$E2FS_PROGS_TARBALL" ]
39 then
40 wget -N "$E2FS_PROGS_HOST/$E2FS_PROGS_TARBALL"
41 check
42 mv $E2FS_PROGS_TARBALL extern
45 if [ ! -f "extern/$KERNEL_TARBALL" ]
46 then
47 wget -N "$KERNEL_HOST/$KERNEL_TARBALL"
48 check
49 mv $KERNEL_TARBALL extern
54 # check_files(): check if files are in the extern directory
56 function check_files()
58 missing="no"
60 if [ ! -f "extern/$KERNEL_TARBALL" ]
61 then
62 if [ "$missing" == "no" ]
63 then
64 echo "********************************************************************************"
65 missing="y"
67 echo "* ERROR: 'extern/$KERNEL_TARBALL' missing"
70 if [ ! -f "extern/$E2FS_PROGS_TARBALL" ]
71 then
72 if [ "$missing" == "no" ]
73 then
74 echo "********************************************************************************"
75 missing="y"
77 echo "* ERROR: 'extern/$E2FS_PROGS_TARBALL' missing"
80 if [ "$missing" == "y" ]
81 then
82 echo "* Call 'get_files.sh' to get the required tarballs from the internet!"
83 echo "********************************************************************************"
84 exit 1
85 else
86 exit 0
90 if [ "$1" == "-c" ]
91 then
92 check_files
93 else
94 get_files