forked from ReinerNippes/nextcloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare_system.sh
executable file
·86 lines (79 loc) · 2.06 KB
/
prepare_system.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
#!/bin/bash
#
# Prepare system for nextcloud
#
prepare_ubuntu() {
$SUDO apt install software-properties-common -y
$SUDO apt-add-repository ppa:ansible/ansible -y
$SUDO apt update -y
$SUDO apt install ansible python-mysqldb python-netaddr mc vim git facter -y
echo
echo "Ubuntu Sytem ready for nextcloud."
echo
}
prepare_debian() {
$SUDO apt install dirmngr mc vim git facter -y
$SUDO apt update -y
$SUDO apt install python-mysqldb python-pip python3-pip facter -y
$SUDO pip install pip -U
$SUDO pip install setuptools -U
$SUDO pip install ansible -U
echo
echo "Debian Sytem ready for nextcloud."
echo
}
prepare_raspbian() {
$SUDO apt install dirmngr mc vim git libffi-dev facter -y
$SUDO apt dist-upgrade -y
$SUDO apt install python-mysqldb python-pip python3-pip facter -y
$SUDO pip install pip -U
$SUDO pip install setuptools -U
$SUDO pip install ansible -U
echo
echo "Rasbpian System ready for nextcloud."
echo
}
prepare_centos() {
$SUDO yum install epel-release -y
$SUDO yum install ansible git vim mc python-mysqldb python-netaddr facter -y
$SUDO yum update -y
echo
echo "CentOS Sytem ready for nextcloud."
echo
}
usage() {
echo
echo "Linux distribution not detected."
echo "Use: IB=[Ubuntu|Debian|CentOS|raspbian] setup_ec2.sh"
echo "Other distributions not yet supported."
echo
}
# get infos about linux distro
if [ -f /etc/os-release ]; then
. /etc/os-release
elif [ -f /etc/debian_version ]; then
$ID=debian
fi
# root or not
if [[ $EUID -ne 0 ]]; then
SUDO='sudo -H'
else
SUDO=''
fi
case $ID in
'ubuntu')
prepare_ubuntu
;;
'debian')
prepare_debian
;;
'raspbian')
prepare_raspbian
;;
'centos')
prepare_centos
;;
*)
usage
;;
esac