This repository has been archived by the owner on Oct 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FCM-tool.sh
executable file
·177 lines (111 loc) · 5.25 KB
/
FCM-tool.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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#!/bin/env bash
clear
# - - Program Path
cd $(dirname "$0")
file_path=$(pwd)
cd ${OLDPWD}
echo $file_path
# - - Read File thats create the main variables of the files
source ${file_path}/variables.sh "${@//'\ '/' '}"
# - - - - Menu
until
clear
# - - Main
[[ ${#} -le 2 ]] && \
${call_func} showMenu " \t \b /----------\ \n\t\b <| FCM-tool |> \n \t \b \----------/\n\n\t\b\b\b\bWhat do you want to do?:-:0Start file creation.:-:1See control manual.:-:2Change main folder.\n\t<| ${main_folder} |>:-:3Exit.04" || \
option=1
case ${option} in
# Close
0)
exit 0
;;
# Create file
1)
until
# - - How many folders
[[ -z ${folder_structures} ]] && \
${call_func} showMenu "How do you want to create the file?:-:0In a single folder.:-:1In multiple folder.:-:2Back.03" || \
option=${folder_structures}
case ${option} in
# Back
0)
break
;;
# Single folder
1)
createFiles
;;
# Multiple folders
2)
until
${call_func} showMenu "In which directories do you want to create the files?:-:0In all directories in the main folder.:-:1Enter the name of the folders.:-:2Back.03"
case ${option} in
# Back
0)
break
;;
# All
1)
clear
read -ra folderList -d '' <<<`ls -d */ 2> /dev/null`
if [ ${#folderList[*]} -eq 0 ]; then
${call_func} pause -beg 0 -end 1 -t5
option=0
else
echo -e "\n You will create your files in the folder(s): ${txt_yellow}${folderList[*]}${txt_none}"
${call_func} pause -t15
clear
${call_func} validateFolderList
clear
${call_func} editFolderList
fi
;;
# Type name
2)
while [[ -z $folderList ]]; do
clear
echo -en "\n Enter the name of the folders ${txt_bold}(different folders separated by space)${txt_none}: "
read -ra folderList
[[ -z $folderList ]] && \
clear && \
pause -beg "You can't use the option to create files in multiple folder without providing the folder name" -end 1 -t15
done
clear
echo -e "\n You will create your files in the folder(s): ${txt_yellow}${folderList[*]}${txt_none}\n"
${call_func} pause -t15
clear
${call_func} validateFolderList
clear
${call_func} editFolderList
;;
*)
${call_func} pause -beg -1 -end -1 -t5
;;
esac
[[ ${option} -ge 1 && ${option} -le 2 ]]
do false ; done
;;
# Try again
*)
${call_func} pause -beg -1 -end -1 -t5
;;
esac
[[ ${option} -ge 1 && ${option} -le 2 ]]
do true ; done
;;
# Help
2)
clear
echo -e "$help_text" | less
;;
# change main folder
3)
${call_func} setMainFolder
;;
# Try again
*)
${call_func} pause -beg -1 -end -1 -t5
;;
esac
[[ ${option} -eq 1 ]]
do false ; done