Change tcp config to reflect some recent changes.
[vpp.git] / extras / vpp_config / scripts / clean.sh
1 #!/bin/bash -x
2 # Copyright (c) 2016 Cisco and/or its affiliates.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at:
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 check_os()
16 {
17
18     # perform some very rudimentary platform detection
19     lsb_dist=''
20     if command_exists lsb_release; then
21         lsb_dist="$(lsb_release -si)"
22     fi
23     if [ -z "$lsb_dist" ] && [ -r /etc/lsb-release ]; then
24         lsb_dist="$(. /etc/lsb-release && echo "$DISTRIB_ID")"
25     fi
26     if [ -z "$lsb_dist" ] && [ -r /etc/fedora-release ]; then
27         lsb_dist='fedora'
28     fi
29     if [ -z "$lsb_dist" ] && [ -r /etc/centos-release ]; then
30         lsb_dist='centos'
31     fi
32     if [ -z "$lsb_dist" ] && [ -r /etc/os-release ]; then
33         lsb_dist="$(. /etc/os-release && echo "$ID")"
34     fi
35
36     lsb_dist="$(echo "$lsb_dist" | tr '[:upper:]' '[:lower:]')"
37     case "$lsb_dist" in
38     fedora|centos|ubuntu|debian)
39         ;;
40     *)
41         echo "Operating system [$lsb_dist] is unsupported"
42         exit 0
43         ;;
44      esac
45     LSB=$lsb_dist
46 }
47
48 check_os
49 case "$LSB" in
50     centos)
51         ROOTDIR='/usr'
52         ;;
53     ubuntu)
54         ROOTDIR='/usr/local'
55         ;;
56     *)
57         echo "$LSB is not supported"
58         exit 1
59         ;;
60 esac
61
62 sudo -H pip uninstall vpp-config
63 sudo rm *~
64 sudo rm *.pyc
65 sudo rm vpplib/*~
66 sudo rm vpplib/*.pyc
67 sudo rm scripts/*~
68 sudo rm data/*~
69 sudo rm -r build
70 sudo rm -r dist
71 sudo rm -r vpp_config.egg-info
72 sudo rm -r $ROOTDIR/vpp/vpp-config
73 sudo rm $ROOTDIR/bin/vpp-config