-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlarafolder.sh
executable file
·49 lines (39 loc) · 1.23 KB
/
larafolder.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
#! /bin/bash
path=$1
if [ -z "$path" ]
then
echo "path to folder"
read path
else
echo "/// Setting up folders and files apache permissions ///"
sudo chown -R www-data:www-data $path
echo -ne '##################\r'
sleep 1
sudo find $path -type f -exec chmod 664 {} \;
echo -ne '##################################\r'
sleep 1
sudo find $path -type d -exec chmod 775 {} \;
echo -ne '#######################################################\r'
echo -ne '\n'
echo "Insert your local user:"
read user
echo "/// Setting up folders and files user permissions ///"
sudo chown -R $user:www-data $path
echo -ne '##################\r'
sleep 1
sudo find $path -type f -exec chmod 664 {} \;
echo -ne '##################################\r'
sleep 1
sudo find $path -type d -exec chmod 775 {} \;
echo -ne '#######################################################\r'
echo -ne '\n'
echo "/// Setting up bootstrap/cache folder permissions ///"
echo -ne '##################\r'
sleep 1
sudo chgrp -R www-data $path/bootstrap/cache
echo -ne '##################################\r'
sleep 1
sudo chmod -R ug+rwx $path/storage
echo -ne '#######################################################\r'
echo -ne '\n'
fi