forked from shlibs/shlibs.sh
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathf2rmrfd.sh
More file actions
executable file
·46 lines (39 loc) · 1.91 KB
/
f2rmrfd.sh
File metadata and controls
executable file
·46 lines (39 loc) · 1.91 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
#!/usr/bin/env sh
# Copyright 2019-2020 (c) all rights reserved by SDRausty see LICENSE
# https://sdrausty.github.io hosted courtesy https://pages.github.com
# File ` f3rmrfd.sh ` deletes files and subdirectories with find to
# rerun ` build.github.bash login ` and also to save space on device.
#####################################################################
set -eu
export RDR="$HOME/buildAPKs"
_F1RMRFMAIN_ () {
[ "${PWD%/*}" = "$RDR/sources/github/orgs" ] || [ "${PWD%/*}" = "$RDR/sources/github/users" ] && _F13R_ || printf "%s\\n\\n" "Run ${0##*/} in directory $RDR/sources/github/{orgs,users}/login to delete files and subdirectories; Exiting... " && exit
}
_F3RMRFMAIN_ () {
[ "$PWD" = "$RDR/sources/github" ] && _F35R_ || printf "%s\\n\\n" "Run ${0##*/} in directory $RDR/sources/github to delete files and subdirectories; Exiting... " && exit
}
_F13R_ () {
find . -mindepth 3 -maxdepth 3 -type f -name NAMES.db -delete || _PRINTSIG_ 64
_DCTLS_
}
_F35R_ () {
find "$RDR/sources/github" -mindepth 5 -maxdepth 5 -type f -name NAMES.db -delete || _PRINTSIG_ 68
_DCTF3_
}
_DCTLS_ () {
"$RDR/scripts/maintenance/delete.corrupt.tars.sh" ls
}
_DCTF3_ () {
"$RDR/scripts/maintenance/delete.corrupt.tars.sh" find3
}
_PRINTSIG_ () {
printf "%s\\n" "SIGNAL $1 GENERATED: Continuing... "
}
_PRINTHELP_ () {
printf "%s\\n\\n" "See \` cat $0 \` for more information as \` ${0##*/} \` removes files and subdirectories as requested! "
cat $0
printf "\\n%s\\n" "Script \` ${0##*/} \` should be run with an option as \` ${0##*/} \` removes files and subdirectories as requested. The \` ${0##*/} \` command can be useful in ~/buildAPKs/sources/github/ when resetting the ~/buildAPKs/sources/github/ subdirectories."
}
# Print help if no arguements are given, else do option 1 or 3.
( [ -z "${1:-}" ] && _PRINTHELP_ ) || ( [ "$1" = 1 ] && _F1RMRFMAIN_ ) || ( [ "$1" = 3 ] && _F3RMRFMAIN_ ) || _PRINTHELP_
# f3rmrfd.sh EOF