-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreInstall.sh
49 lines (44 loc) · 1.42 KB
/
preInstall.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
echo "Определите тип взаимодействия ([1] - использование, 2 - разработка):";
read type;
if test -z $type; then
type='1';
fi;
if test $type = '2'; then
# Разработка
chmod -R 777 .;
else
# Использование
echo "Введите имя пользователя [www-data]:";
read user;
if test -z $user; then
user='www-data';
fi;
chown -R $user:$user .;
echo "Введите HEX представление прав доступа к каталогам [755]:";
read dirAccess;
if test -z $dirAccess; then
dirAccess='755';
fi;
find -type d -exec chmod $dirAccess {} \;
echo "Введите HEX представление прав доступа к файлам [744]:";
read fileAccess;
if test -z $fileAccess; then
fileAccess='744';
fi;
find -type f -exec chmod $fileAccess {} \;
echo "Введите HEX представление прав доступа к скриптам [500]:";
read scriptAccess;
if test -z $scriptAccess; then
scriptAccess='500';
fi;
find -name "*.php" -exec chmod $scriptAccess {} \;
echo "Введите HEX представление прав доступа к файлам данных [700]:";
read dataAccess;
if test -z $datatAccess; then
dataAccess='700';
fi;
find -name "*.ini" -exec chmod $dataAccess {} \;
fi;
chmod -x preInstall.sh
echo 'Complete';