summaryrefslogtreecommitdiffstats
path: root/helper_scripts/glusterfs_uninstall.sh
blob: b3378fd7143156746b691b69385c8f06d2704725 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash

#set -x;

function _init ()
{
 #   echo $0;
 #   echo $#;
 #   echo $1;
    set -u;
    if [ $# -lt 1 ]; then
	    echo "usage: download_and_install <glusterfs-version>";
	    exit 1;
    fi

    version=$1;
    echo $version;
    echo $version | grep "glusterfs" 2>/dev/null 1>/dev/null;
    if [ $? -ne 0 ]; then
	echo "given argument is not glusterfs";
	exit 1;
    fi
}

function un_install ()
{
    cd /root/$version;

    cd build;
    make uninstall && make clean && make distclean;

    cd /root;
}

main ()
{

    if [ ! -d $version ]; then
	echo "the glusterfs version ($version) directory is not there."
	return 1;
    fi

    un_install;
}

_init "$@" && main "$@"