forked from lucascbeyeler/zmbackup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·87 lines (80 loc) · 2.35 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
################################################################################
# install - Install script to help you install zmbackup in your server. You can
# simply ignore this file and move the files to the correctly place, but
# the chance for this goes wrong is big. So, this script made everything
# for you easy.
#
################################################################################
# INSTALL MAIN CODE
################################################################################
#
# Help code
################################################################################
if [[ $1 == "--help" ]] || [[ $1 == "-h" ]]; then
show_help
exit "$ERR_OK"
fi
################################################################################
# LOADING INSTALL LIBRARIES
################################################################################
echo "Loading installer - PLEASE WAIT"
source installScript/check.sh
source installScript/depDownload.sh
source installScript/deploy.sh
source installScript/menu.sh
source installScript/vars.sh
source installScript/help.sh
#
# Checking your environment
################################################################################
check_env "$1"
#
# Uninstall code
################################################################################
if [[ $1 == "--remove" ]] || [[ $1 == "-r" ]]; then
if [[ $UNINSTALL = "Y" ]]; then
if [[ $SO = "ubuntu" ]]; then
echo "Disabled Package Uninstall"
# remove_ubuntu
else
echo "Disabled Package Uninstall"
# remove_redhat
fi
uninstall
echo "Uninstall completed. Thanks for using Zmbackup. Have a nice day!"
exit "$ERR_OK"
else
echo "Zmbackup is not installed - nothing to do"
exit "$ERR_OK"
fi
fi
#
# Install & Upgrade code
################################################################################
contract
if [[ $UPGRADE = "Y" ]]; then
if [[ $SO = "ubuntu" ]]; then
install_ubuntu
else
install_redhat
fi
deploy_upgrade
else
set_values
check_config
if [[ $SO = "ubuntu" ]]; then
install_ubuntu
else
install_redhat
fi
deploy_new
fi
# We're done!
read -r -p "Install completed. Do you want to display the README file? (Y/n)" tmp
case "$tmp" in
y|Y|Yes|"") less "$MYDIR"/README.md;;
*) echo "Done!";;
esac
clear
exit "$ERR_OK"