USR910x_3.04L.01_consumer.tar.gz
[bcm963xx.git] / consumer_install
1 #! /bin/bash
2
3 bi_src_base=/opt
4 bi_crosstools_inst_dir=$bi_src_base/toolchains
5 bi_this_dir=`pwd`
6
7 clear
8 echo ""
9 echo "This script installs BCM963xx DSL router components onto your Linux PC.  The"
10 echo "installation will overwrite existing files.  You will be prompted before a"
11 echo "component is installed."
12 echo ""
13 echo "This script may create directories and overwrite existing files.  Therefore,"
14 echo "you will need to have root privilages to run this script."
15 echo ""
16 read -p "Press 'y' to continue: " -n 1 dr_continue
17 echo ""
18 if [ "$dr_continue" != "y" ] ; then
19     echo "";
20     echo "exiting script";
21     echo "";
22     exit
23 fi
24
25 for f in *
26 do
27     case $f in
28     bcm963*_consumer.tar.gz)
29         bi_src_dir=$bi_src_base/bcm963xx_router
30         echo ""
31         echo "The bcm963xx DSL router source files are ready to be installed at "
32         echo "$bi_src_dir. Existing source files, in any, will be overwritten. "
33         echo ""
34         read -p "Press 'y' to install the bcm963xx DSL router source files: " -n 1 dr_continue
35         echo ""
36         echo ""
37         if [ "$dr_continue" == "y" ] ; then
38             echo ""
39             if ! [ -d $bi_src_dir ] ; then
40                 echo "Creating directory $bi_src_dir."
41                 echo ""
42                 mkdir -p $bi_src_dir
43             fi
44             if [ -d $bi_src_dir ] ; then
45                 echo "Installing files from $bi_this_dir/$f."
46                 echo ""
47                 cd $bi_src_dir
48                 tar xfz $bi_this_dir/$f
49                 chmod -R 777 * .*
50             else
51                 echo "The directory $bi_src_dir does not exist."
52                 echo "The BCM963xx DSL router source files were not installed."
53             fi
54         else
55             echo "The BCM963xx DSL router source files were not installed."
56         fi
57         echo ""
58         ;;
59     bcm963*_uclibc_crosstools*.tar.gz)
60         echo ""
61         echo "The BCM963xx DSL router toolchain is ready to be installed at $bi_crosstools_inst_dir."
62         echo "Existing toolchain files, if any, will be overwritten."
63         echo ""
64         read -p "Press 'y' to install the BCM963xx toolchain: " -n 1 dr_continue
65         echo ""
66         echo ""
67         if [ "$dr_continue" == "y" ] ; then
68             echo ""
69             if ! [ -d $bi_src_base ] ; then
70                 echo "Creating directory $bi_src_base."
71                 echo ""
72                 mkdir -p $bi_src_base
73             fi
74             if [ -d $bi_src_base ] ; then
75                 echo "Installing files from $bi_this_dir/$f."
76                 echo ""
77                 cd $bi_this_dir
78                 tar xfzv $f
79                 rpm -ivh uclibc-crosstools*.rpm
80             else
81                 echo "The directory $bi_src_base does not exist."
82                 echo "The BCM963xx toolchain was not installed."
83             fi
84         else
85             echo "The BCM963xx toolchain was not installed."
86         fi
87         echo ""
88         ;;
89     esac
90 done
91
92 cd $bi_this_dir
93