-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.sh
More file actions
executable file
·105 lines (92 loc) · 1.76 KB
/
Copy pathconfig.sh
File metadata and controls
executable file
·105 lines (92 loc) · 1.76 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
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
95
96
97
98
99
100
101
102
103
104
105
#!/bin/ash
NAME="elsa"
NICKNAME="eltouma"
DB_PW=""
DB_ROOT_PW=""
WP_USERPASS=""
ADM_WP_PASS=""
makefile="Makefile"
secrets="secrets"
credentials="credentials.txt"
db_password="db_password.txt"
db_root_password="db_root_password.txt"
srcs="srcs"
docker_compose="docker-compose.yml"
env=".env"
requirements="requirements"
mariadb="mariadb"
nginx="nginx"
tools="tools"
wordpress="wordpress"
echo "secrets" > .gitignore
inception=(
"$secrets"
"$srcs"
)
secrets_d=(
"$credentials"
"$db_password"
"$db_root_password"
)
srcs_d=(
"$docker_compose"
"$env"
)
req_d=(
"$mariadb"
"$nginx"
"$tools"
"$wordpress"
)
if [ ! -f "$makefile" ]; then
touch "$makefile"
echo "$makefile created"
else
echo "$makefile already exists"
fi
for dir in "${inception[@]}"; do
if [ ! -d "$dir" ]; then
mkdir -p "$dir"
echo "Directory '$dir' created"
else
echo "Directory $dir already exists"
fi
done
for s_file in "${secrets_d[@]}"; do
file_path="$secrets/$s_file"
if [ ! -f "$file_path" ]; then
touch "$file_path"
echo "File '$file_path' created"
else
echo "File $file_path already exists"
fi
done
for srcs_file in "${srcs_d[@]}"; do
file_path="$srcs/$srcs_file"
if [ ! -f "$file_path" ]; then
touch "$file_path"
echo "File '$file_path' created"
else
echo "File $file_path already exists"
fi
done
if [ ! -f "$requirements" ]; then
dir_path="$srcs/$requirements"
if [ ! -d "$dir_path" ]; then
mkdir -p "$dir_path"
echo "Directory $dir_path created"
else
echo "Directory $dir_path already exists"
fi
fi
for req_dir in "${req_d[@]}"; do
dir_path="$srcs/$requirements/$req_dir"
if [ ! -d "$dir_path" ]; then
mkdir -p "$dir_path"
echo "Directory '$dir_path' created"
else
echo "Directory $dir_path already exists"
fi
done
: <<'END_COMMENT'
END_COMMENT