-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen-joomlamigrate.sh
More file actions
44 lines (37 loc) · 1.19 KB
/
gen-joomlamigrate.sh
File metadata and controls
44 lines (37 loc) · 1.19 KB
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
#!/bin/bash
filename=$1
#cleanup
#HELLO=":hello:"
#HELLO=$(strip "$HELLO" ":")
#echo $HELLO # hello
echo "Cleaning all file and directory ..."
echo "" > php-gen.ini
echo "" > logrepot.txt
rm tmp/*
echo "Beginnning migration process ... "
while read -r line
do
name="$line"
DATE=`date '+%Y-%m-%d %H:%M:%S'`
# echo "Name read from file - $name"
sshpass -f 'mypass' scp -r /var/www/html/$name username@servername.usm.my:~/joomla-migrate-2018
echo "#"
echo "[PATH=/var/www/html/$name]" >> php-gen.ini
echo "open_basedir = /var/www/html/$name" >> php-gen.ini
echo "upload_tmp_dir = /var/www/html/$name/tmp" >> php-gen.ini
apacheconfname=${name//".usm.my"/}
#$(strip "$name" "usm.my")
echo "<Directory \"/var/www/html/$name\">
RewriteEngine On
RewriteOptions Inherit
<LimitExcept GET POST>
Deny from all
</LimitExcept>
Options FollowSymLinks IncludesNoExec
AllowOverride All
Order allow,deny
Allow from all
</Directory>" > "tmp/$apacheconfname.conf"
echo "">> php-gen.ini
echo "DONE ($DATE) - $name" >> logrepot.txt
done < "$filename"