-
Notifications
You must be signed in to change notification settings - Fork 10
/
lazydubuntu.sh
executable file
·138 lines (113 loc) · 3.92 KB
/
lazydubuntu.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/bash
# Lazy Dubuntu
# Setting Up my Drupal Enviroment in Ubuntu
# Requiriment sudo
if [[ $UID != 0 ]]; then
echo "Please run this script with sudo:"
echo "sudo $0 $*"
exit 1
fi
# Git Configuration
# To learn more about git configuration:
# http://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration
EmailValidation="^[a-z0-9!#\$%&'*+/=?^_\`{|}~-]+(\.[a-z0-9!#$%&'*+/=?^_\`{|}~-]+)*@([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]([a-z0-9-]*[a-z0-9])?\$"
echo
echo ---------------------------------------------------------------------------
echo "Git required to add your full-name and e-mail."
echo "This will set-up the --global user.name and --global user.email"
echo ---------------------------------------------------------------------------
echo
# Asking for a full name
read -p "Enter Your Full Name: " GitFullName
# Making the full name avaible across all the scripts
export GitFullName
# Asking for the e-mail and validate that is an e-mail.
while true
do
read -p "Enter Email : " GitEmail
echo
if [[ $GitEmail =~ $EmailValidation ]] ; then
export GitEmail
break
else
echo "Invalid e-mail, Please enter a valid e-mail"
fi
done
# MySQL & phpMyadmin Password.
echo
echo ---------------------------------------------------------------------------
echo MySQL '&' phpMyAdmin
echo This is going to be the root password.
echo ---------------------------------------------------------------------------
# Asking for password and a confirmation.
while true
do
read -s -p "Password: " MYSQLPassword
echo
read -s -p "Confirm Password: " MYSQLPassword2
echo
[ "$MYSQLPassword" = "$MYSQLPassword2" ] && break
echo "Password does not match, Please try again."
done
# Making the MySql Password avaible across all the scripts
export MYSQLPassword
echo
echo ---------------------------------------------------------------------------
echo Setting Up SSMTP to send emails from Ubuntu
echo You would need an Gmail account.
echo ---------------------------------------------------------------------------
echo
# Asking for the e-mail and validate that is an e-mail.
while true
do
echo -------------------------------------------------------------------------
echo "Pro Tip: You need make sure that you are typing your information"
echo "correctly. If this credentials are wrong Drupal will not be able to send"
echo "e-mails from you local envrironment."
echo -------------------------------------------------------------------------
echo
read -p "Enter Your Gmail To Configure SSMTP: " PostMaster
echo
if [[ $PostMaster =~ $EmailValidation ]] ; then
export PostMaster
break
else
echo "Invalid e-mail, Please enter a valid e-mail"
fi
done
echo ---------------------------------------------------------------------------
echo 'Pro Tip: Usually Gmail Username can be found by deteling @gmail.com from'
echo 'your gmail.com. For instance if your gmail is [email protected], your'
echo 'username will be drupal. Password should be the same as your gmail.'
echo ---------------------------------------------------------------------------
echo
read -p "Enter Your Gmail Username: " GmailUser
# Making the Gmail Username avaible across all the scripts
export GmailUser
# Asking for password and a confirmation.
while true
do
read -s -p "Password: " GmailPassword
echo
read -s -p "Confirm Password: " GmailPassword2
echo
[ "$GmailPassword" = "$GmailPassword2" ] && break
echo "Password does not match, Please try again."
done
# Making the Gmail Password avaible across all the scripts
export GmailPassword
# LampStack
echo "Lamp Stack Installation"
sudo -E bash bin/lampstack.sh
# Basic Web Development Tools
echo "Basic Web Development Tools"
sudo -E bash bin/basictools.sh
# Lazy Aliases
echo "Lazy Aliases"
sudo bash bin/lazyaliases.sh
# Web Designers
echo "Web Front-end Development Tools"
sudo bash bin/webdesigner.sh
# Web Developers
echo "Web Back-end Development Tools"
sudo bash bin/webdeveloper.sh