helper-script clean up
g0tmi1k
4 years ago
2 | 2 | ## Generate: awk -F ': ' '/^Description: / {print $2}' debian/control |
3 | 3 | description="netshell features all in version 2 powershell" |
4 | 4 | package="powercat" |
5 | location="/usr/share/windows-resources/powercat" | |
5 | location="/usr/share/windows-resources/${package}" | |
6 | 6 | |
7 | 7 | |
8 | 8 | ## Define command line arguments |
15 | 15 | opt="$1"; |
16 | 16 | shift; |
17 | 17 | case "$opt" in |
18 | "-h") | |
19 | banner="true" ;; | |
20 | "-v") | |
21 | output="true" ;; | |
18 | #"-h") | |
19 | # banner="true" ;; | |
20 | #"-v") | |
21 | # output="true" ;; | |
22 | 22 | "-q") |
23 | 23 | banner="false"; |
24 | 24 | output="false";; |
30 | 30 | |
31 | 31 | |
32 | 32 | ## Move to location |
33 | cd "${location}" | |
33 | cd "${location}/" | |
34 | 34 | |
35 | 35 | |
36 | 36 | ## Feedback (-h) |
41 | 41 | ## List output (-v) |
42 | 42 | if [ "${output}" == "true" ]; then |
43 | 43 | if [ "$( which tree )" ]; then |
44 | #tree -d -L 1 --prune --noreport "${location}" | |
45 | tree -L 1 --prune --noreport "${location}" | |
44 | tree -d -L 1 --prune --noreport "${location}" | |
46 | 45 | else |
47 | echo "${location}" | |
46 | echo "${location}" | |
48 | 47 | |
49 | #ls --color | |
50 | #find "${location}" -maxdepth 1 -mindepth 1 -type d \ | |
51 | find "${location}" -maxdepth 1 -mindepth 1 \ | |
52 | | sort \ | |
53 | | sed -e 's/[^-][^\/]*\//-/g; s/^/ /; s/-/|/' | |
48 | #ls --color | |
49 | find "${location}" -maxdepth 1 -mindepth 1 -type d \ | |
50 | | sort \ | |
51 | | sed -e 's/[^-][^\/]*\//-/g; s/^/ /; s/-/|/' | |
54 | 52 | fi |
55 | 53 | fi |
56 | 54 |