-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdrushScript.sh
executable file
·76 lines (37 loc) · 1.08 KB
/
drushScript.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
#!/bin/sh
wawa=$1;
pluginDir=$1;
mainDir=$2;
drushInstalled=$3;
backupS=$4;
drupalRoot=$5;
flag=$6;
installDrush=$7;
composerPhar=$8;
cd $mainDir;
cwd=$(pwd);
if [[ "$mainDir" = "$cwd" ]]; then
cd $mainDir;
if [[ "$installDrush" = yes ]]; then
$composerPhar require drush/drush;
fi
if [[ "$flag" = no ]]; then
touch $mainDir/CurrEnv.txt;
chmod 777 $mainDir/CurrEnv.txt;
$mainDir/vendor/bin/drush sql-conf --show-passwords > CurrEnv.txt;
fi
if [[ "$backupS" = yes ]]; then
mkdir $mainDir/backup;
cd $mainDir;
$mainDir/vendor/bin/drush sql-dump --result-file $mainDir/backup/old_db.sql;
tar -zcvf archive_original.tar.gz .;
mv $mainDir/archive_original.tar.gz $mainDir/backup/archive_original.tar.gz;
fi
if [[ "$flag" = no ]]; then
chmod 777 $drupalRoot/sites/default/settings.php;
chmod -R 777 $drupalRoot/sites/default;
fi
touch $mainDir/settings.tmp.php;
chmod 777 $mainDir/settings.tmp.php;
touch $mainDir/settings_orig.php;
fi