-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·53 lines (46 loc) · 1.17 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
if [ -r ../common.sh ]; then
. ../common/common.sh
else
curl=$(which curl)
r=$?
if [ $r == 0 ]; then
$curl -o /tmp/common.sh https://raw.githubusercontent.com/ApptuitAI/prometheus-exporters/master/common/common.sh
else
wget=$(which wget)
r=$?
if [ $r == 0 ]; then
$wget -O /tmp/common.sh https://raw.githubusercontent.com/ApptuitAI/prometheus-exporters/master/common/common.sh
else
echo "Neither 'curl' nor 'wget' found. Please install at least one of these packages."
exit 1
fi
fi
. /tmp/common.sh
fi
PACKAGE_NAME='node-exporter'
OS=$(get_os)
function configure_exporter() {
print_message "info" "No localization needed for node-exporter"
return
}
trap 'post_error ${PACKAGE_NAME}' ERR
check_root
setup_log $PACKAGE_NAME
post_complete $PACKAGE_NAME
case $OS in
RedHat)
install_redhat $PACKAGE_NAME
configure_exporter $0
start_service $PACKAGE_NAME
;;
Debian)
install_debian $PACKAGE_NAME
configure_exporter $0
start_service $PACKAGE_NAME
;;
*)
print_message "error" "Your OS/distribution is not supported by this install script.\n"
exit 1;
;;
esac