This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathd2df.sh
496 lines (453 loc) · 9.99 KB
/
d2df.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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
#!/usr/bin/bash
#/system/bin/sh
#$0
# D2DF stands for Destroy or Disable the Default Folder a small tool to disable some features or permanently remove unwanted folders, manually deleting it the media system can still create a folder on the sdcard (default automatically) and then I named it the default folder.
# Built 19 Oct 2021 16.46.51 [v1.0.0]
# Update 27 Oct 2021 13.17.16 [v1.0.1]
# Copyright (c) 2021 Luis Adha on /~https://github.com/luisadha
# Report bugs: adharudin14@gmail.com
#GNU################################################## BEGIN LICENSE GPLv3
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
#GPL################################################## END LICENSE http://www.gnu.org/licenses
BL='\e[01;90m' > /dev/null 2>&1; # Black
R='\e[01;91m' > /dev/null 2>&1; # Red
G='\e[01;92m' > /dev/null 2>&1; # Green
Y='\e[01;93m' > /dev/null 2>&1; # Yellow
B='\e[01;94m' > /dev/null 2>&1; # Blue
P='\e[01;95m' > /dev/null 2>&1; # Purple
C='\e[01;96m' > /dev/null 2>&1; # Cyan
W='\e[01;97m' > /dev/null 2>&1; # White
N='\e[0m' > /dev/null 2>&1; # Null
DELAY="2";
# .FACE [samsung devices]
clear
current_value=$(test -d /sdcard/.face; echo $?)
if [ "$current_value" == '0' ]
then
CONDITION=$G"Alive"$N
elif [ "$current_value" == '1' ]
then
CONDITION=$B"Disabled"$N
else
CONDITION=$BL"Unknown/Null"$N
fi
# DCIM [all devices]
current_value=$(test -d /sdcard/DCIM; echo $?)
if [ "$current_value" == '0' ]
then
CONDITION1=$G"Alive"$N
elif [ "$current_value" == '1' ]
then
CONDITION1=$BL"R.I.P"$N
else
CONDITION1=$BL"Unknown/Null"$N
fi
# DOWNLOAD [all devices]
current_value=$(test -d /sdcard/Download; echo $?)
if [ "$current_value" == '0' ]
then
DOWNLOAD=$G"Alive"$N
elif [ "$current_value" == '1' ]
then
DOWNLOAD=$BL"R.I.P"$N
else
DOWNLOAD=$BL"Unknown/Null"$N
fi
# PICTURES [all devices]
current_value=$(test -d /sdcard/Pictures; echo $?)
if [ "$current_value" == '0' ]
then
PICTURES=$G"Alive"$N
elif [ "$current_value" == '1' ]
then
PICTURES=$BL"R.I.P"$N
else
PICTURES=$BL"Unknown/Null"$N
fi
# PLAYLISTS [all devices]
current_value=$(test -d /sdcard/Playlists; echo $?)
if [ "$current_value" == '0' ]
then
PLAYLISTS=$G"Alive"$N
elif [ "$current_value" == '1' ]
then
PLAYLISTS=$B"Disabled"$N
else
PLAYLISTS=$BL"Unknown/Null"$N
fi
### RINGTONES [all devices]
current_value=$(test -d /sdcard/Ringtones; echo $?)
if [ "$current_value" == '0' ]
then
RINGTONES=$G"Alive"$N
elif [ "$current_value" == '1' ]
then
RINGTONES=$B"Disabled"$N
else
RINGTONES=$BL"Unknown/Null"$N
fi
### SOUNDS [all devices]
current_value=$(test -d /sdcard/Sounds; echo $?)
if [ "$current_value" == '0' ]
then
SOUNDS=$G"Alive"$N
elif [ "$current_value" == '1' ]
then
SOUNDS=$B"Disabled"$N
else
SOUNDS=$BL"Unknown/Null"$N
fi
function menu() {
echo -e $W"List of Folder: " $N
echo -e $W"1. .face | $CONDITION "$N
echo -e $W"2. DCIM | $CONDITION1 "$N
echo -e $W"3. Download | $DOWNLOAD "$N
echo -e $W"4. Pictures | $PICTURES "$N
echo -e $W"5. Playlist | $PLAYLISTS "$N
echo -e $W"6. Ringtones | $RINGTONES "$N
echo -e $W"7. Sounds | $SOUNDS " $N
echo -e $W"0. Exit "$N
read main
while :
do
case $main in
1)
while :
do
current_value=$(test -d /sdcard/.face; echo $?)
if [ "$current_value" == '0' ]
then
CONDITION=$G"Alive"$N
elif [ "$current_value" == '1' ]
then
CONDITION=$B"Disabled"$N
else
CONDITION=$BL"Unknown/Null"$N
fi
clear
echo -e $Y'[Destroy The Default Folder]'$N
echo -e $Y'FACE'$N
echo ''
echo -e $W"CURRENT:$CONDITION"$N
echo -e $W"1. Default"$N
echo -e $W"2. Disable"$N
echo -e $W'0. Go Back'$N
echo -e -n $W'[CHOOSE] :'$N
read disable
case $disable in
1)
rm -f /sdcard/.face > /dev/null 2>&1;
mkdir /sdcard/.face
;;
2)
rm -rf /sdcard/.face
touch /sdcard/.face > /dev/null 2>&1;
;;
0)
clear
menu;
;;
esac
sleep $DELAY
done
;;
############
2)
while :
do
current_value=$(test -d /sdcard/DCIM; echo $?)
if [ "$current_value" == '0' ]
then
CONDITION1=$G"Alive"$N
elif [ "$current_value" == '1' ]
then
CONDITION1=$BL"R.I.P"$N
else
CONDITION1=$BL"Unknown/Null"$N
fi
clear
echo -e $Y'[Destroy or Disable The Default Folder]'$N
echo -e $Y'DCIM'$N
echo ''
echo -e $W"CURRENT:$CONDITION1"$N
echo -e $W"1. Default"$N
echo -e $W"2. Destroy"$N
echo -e $W'0. Go Back'$N
echo -e -n $W'[CHOOSE] :'$N
read disable
case $disable in
1)
rm -f /sdcard/DCIM > /dev/null 2>&1;
mkdir /sdcard/DCIM
;;
2)
echo "Destroy!!? files under DCIM will be remove";
echo "[1:CONTINUE,0:BACK]";
read PROMPT
case $PROMPT in
1)
rm -rf /sdcard/DCIM
touch /sdcard/DCIM > /dev/null 2>&1;
;;
0)
break
;;
esac
;;
0)
clear
menu;
;;
esac
sleep $DELAY
done
;;
3)
############
while :
do
current_value=$(test -d /sdcard/Download; echo $?)
if [ "$current_value" == '0' ]
then
DOWNLOAD=$G"Alive"$N
elif [ "$current_value" == '1' ]
then
DOWNLOAD=$BL"R.I.P"$N
else
DOWNLOAD=$BL"Unknown/Null"$N
fi
clear
echo -e $Y'[Destroy or Disable The Default Folder]'$N
echo -e $Y'Download'$N
echo ''
echo -e $W"CURRENT:$DOWNLOAD "$N
echo -e $W"1. Default "$N
echo -e $W"2. Destroy ${R}[Not Recomended]"$N
echo -e $W'0. Go Back'$N
echo -e -n $W'[CHOOSE] :'$N
read disable
case $disable in
1)
rm -f /sdcard/Download > /dev/null 2>&1;
mkdir /sdcard/Download
;;
2)
echo "Destroy!!? files under Download will be remove";
echo "[1:CONTINUE,0:BACK]";
read PROMPT
case $PROMPT in
1)
rm -rf /sdcard/Download
touch /sdcard/Download > /dev/null 2>&1;
;;
0)
break
;;
esac
;;
0)
clear
menu;
;;
esac
sleep $DELAY
done
;;
4)
###########
while :
do
current_value=$(test -d /sdcard/Pictures; echo $?)
if [ "$current_value" == '0' ]
then
PICTURES=$G"Alive"$N
elif [ "$current_value" == '1' ]
then
PICTURES=$BL"R.I.P"$N
else
PICTURES=$BL"Unknown/Null"$N
fi
clear
echo -e $Y'[Destroy or Disable The Default Folder]'$N
echo -e $Y'Pictures'$N
echo ''
echo -e $W"CURRENT:$PICTURES "$N
echo -e $W"1. Default "$N
echo -e $W"2. Destroy ${R}[Not Recomended]"$N
echo -e $W'0. Go Back'$N
echo -e -n $W'[CHOOSE] :'$N
read disable
case $disable in
1)
rm -f /sdcard/Pictures > /dev/null 2>&1;
mkdir /sdcard/Pictures
;;
2)
echo "Destroy!!? files under Pictures will be remove";
echo "[1:CONTINUE,0:BACK]";
read PROMPT
case $PROMPT in
1)
rm -rf /sdcard/Pictures
touch /sdcard/Pictures > /dev/null 2>&1;
;;
0)
break
;;
esac
;;
0)
clear
menu;
;;
esac
sleep $DELAY
done
;;
5)
###########
while :
do
current_value=$(test -d /sdcard/Playlists; echo $?)
if [ "$current_value" == '0' ]
then
PLAYLISTS=$G"Alive"$N
elif [ "$current_value" == '1' ]
then
PLAYLISTS=$B"Disabled"$N
else
PLAYLISTS=$BL"Unknown/Null"$N
fi
clear
echo -e $Y'[Destroy or Disable The Default Folder]'$N
echo -e $Y'Playlists'$N
echo ''
echo -e $W"CURRENT:$PLAYLISTS "$N
echo -e $W"1. Default "$N
echo -e $W"2. Disable "$N
echo -e $W'0. Go Back'$N
echo -e -n $W'[CHOOSE] :'$N
read disable
case $disable in
1)
rm -f /sdcard/Playlists > /dev/null 2>&1;
mkdir /sdcard/Playlists
;;
2)
rm -rf /sdcard/Playlists
touch /sdcard/Playlists > /dev/null 2>&1;
;;
0)
clear
menu;
;;
esac
sleep $DELAY
done
;;
6)
###########
while :
do
current_value=$(test -d /sdcard/Ringtones; echo $?)
if [ "$current_value" == '0' ]
then
RINGTONES=$G"Alive"$N
elif [ "$current_value" == '1' ]
then
RINGTONES=$B"Disabled"$N
else
RINGTONES=$BL"Unknown/Null"$N
fi
clear
echo -e $Y'[Destroy or Disable The Default Folder]'$N
echo -e $Y'Ringtones'$N
echo ''
echo -e $W"CURRENT:$RINGTONES"$N
echo -e $W"1. Default "$N
echo -e $W"2. Disable "$N
echo -e $W'0. Go Back'$N
echo -e -n $W'[CHOOSE] :'$N
read disable
case $disable in
1)
rm -f /sdcard/Ringtones > /dev/null 2>&1;
mkdir /sdcard/Ringtones
;;
2)
rm -rf /sdcard/Ringtones
touch /sdcard/Ringtones > /dev/null 2>&1;
;;
0)
clear
menu;
;;
esac
sleep $DELAY
done
;;
7)
while :
do
current_value=$(test -d /sdcard/Sounds; echo $?)
if [ "$current_value" == '0' ]
then
SOUNDS=$G"Alive"$N
elif [ "$current_value" == '1' ]
then
SOUNDS=$B"Disabled"$N
else
SOUNDS=$BL"Unknown/Null"$N
fi
clear
echo -e $Y'[Destroy or Disable The Default Folder]'$N
echo -e $Y'Sounds'$N
echo ''
echo -e $W"CURRENT:$SOUNDS "$N
echo -e $W"1. Default "$N
echo -e $W"2. Disable "$N
echo -e $W'0. Go Back'$N
echo -e -n $W'[CHOOSE] :'$N
read disable
case $disable in
1)
rm -f /sdcard/Sounds > /dev/null 2>&1;
mkdir /sdcard/Sounds
;;
2)
rm -rf /sdcard/Sounds
touch /sdcard/Sounds > /dev/null 2>&1;
;;
0)
clear
menu;
;;
esac
sleep $DELAY
done
###########
;;
###########
0)
clear
exit 0
;;
*)
clear
echo "wrong input!";
sleep 1.5
clear
menu;
;;
esac
sleep $DELAY
done
}
menu;