-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·95 lines (70 loc) · 2.32 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
88
89
90
91
92
93
94
#!/bin/bash
clear
parentDir=~
defaultDir=$parentDir/checkoutcrypto-drupal
siteDir="/var/www/site"
# CheckoutCrypto Menu
Exit=0
until [ $Exit -eq 1 ]; do
echo "CheckoutCrypto Menu"
echo " Choices:"
echo "1) Install Drush"
echo "2) Install Drupal quick"
echo "3) Download/Update Dependency Modules"
echo "4) Install Dependency Modules"
echo "5) Read Configure Guide"
echo "6) Exit"
read choice
case $choice in
#check if drush is installed - if not install
1)
type drush >/dev/null 2>&1 && echo "Drush installed." || sudo apt-get install drush
;;
#drush install quick site - change site to whatever you prefer
2)
echo "Enter the site directory to install to e.g. /var/www/site"
read siteDir
sudo mkdir $siteDir
cd $siteDir
echo "you are about to install drupal in this present directory. \n Hit y to all the questions. If it fails to install that database, don't worry, you can configure it after. "
echo "\n press any key to continue"
read choice
sudo drush core-quick-drupal
sudo cp ./quick-drupal-*/drupal/* . -R
cd ./sites/default/
sudo rm settings.php
sudo cp default.settings.php ./settings.php
sudo chmod 777 $siteDir/sites/default/files
sudo chmod 777 $siteDir/sites/default/settings.php
echo "\n\n\n visit https://yoursite/install.php to setup the database configuration n\n\n"
;;
# git clone repository
3)
echo "Checking if git is installed........."
type git >/dev/null 2>&1 && echo "Git installed." || sudo apt-get install git
if [ -d "$defaultDir" ]; then
cd $defaultDir
echo "Pulling changes(if any) from CheckoutCrypto's Drupal repo"
git pull
else
echo "Downloading the CheckoutCrypto Drupal dependencies to your home folder"
cd $parentDir
git clone https://github.com/CheckoutCrypto/checkoutcrypto-drupal
fi
;;
4)
echo "Do you want to use a different site directory[y/n] ? \n (Hint: If you didn't install drupal using drush in previous menu steps, use this option)"
read newsiteChoice
if [ $newsiteChoice = "y" ]
then
echo "Enter the site directory to install to e.g. /var/www/site"
read siteDir
fi
for i in $defaultDir/ccStore_extend/ccStore_modules/*.tar.gz; do sudo tar xvzf $i -C $siteDir/sites/all/modules; done
for i in $defaultDir/ccStore_extend/ccStore_theme/*.tar.gz; do sudo tar xvzf $i -C $siteDir/sites/all/themes; done
;;
5) sudo tail -n 200 ./README.md
;;
6) Exit=1 ;;
esac
done