-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
54 lines (42 loc) · 1.16 KB
/
install.sh
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
47
48
49
50
51
52
53
#!/bin/bash
OS=$(awk '/DISTRIB_ID=/' /etc/*-release | sed 's/DISTRIB_ID=//' | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/')
VERSION=$(awk '/DISTRIB_RELEASE=/' /etc/*-release | sed 's/DISTRIB_RELEASE=//' | sed 's/[.]0/./')
INSTALL_DIR="/etc/nodeping"
if [ -z "$OS" ]; then
OS=$(awk '{print $1}' /etc/*-release | tr '[:upper:]' '[:lower:]')
fi
if [ -z "$VERSION" ]; then
VERSION=$(awk '{print $3}' /etc/*-release)
fi
echo "Installing NodePing Check Scripts For $OS"
echo "Cloning NodePing CheckScripts Repository"
case $OS in
ubuntu)
if ! which git > /dev/null; then
apt-get install git-core -y
fi
if [ -d $INSTALL_DIR ]
then
cd $INSTALL_DIR
`which git` reset --hard && `which git` pull origin master
else
# Create test-scripts directory for xinetd
[ -d $INSTALL_DIR ] || mkdir -p $INSTALL_DIR
`which git` clone git://github.com/cbake6807/NodePing_PORT-Checking-Scripts.git $INSTALL_DIR
fi
cd $INSTALL_DIR
sh xinetd-install/install-ubuntu.sh
;;
centos)
echo "No CentOS Support Yet";
exit 0;
;;
debian)
bash xinetd-install/install-ubuntu.sh
;;
darwin)
echo "No Darwin Support Yet";
exit 0;
;;
esac