forked from Montspy/LooPyGen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.sh
More file actions
executable file
·56 lines (48 loc) · 1.76 KB
/
cli.sh
File metadata and controls
executable file
·56 lines (48 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
#!/usr/bin/env bash
name="loopygen-cli"
tag="sk33z3r/$name"
update() {
cat <<EOF
+-------------------------------------------------+
| |
| ░▒█░░░░▄▀▀▄░▄▀▀▄░▒█▀▀█░█░░█░▒█▀▀█░█▀▀░█▀▀▄ |
| ░▒█░░░░█░░█░█░░█░▒█▄▄█░█▄▄█░▒█░▄▄░█▀▀░█░▒█ |
| ░▒█▄▄█░░▀▀░░░▀▀░░▒█░░░░▄▄▄▀░▒█▄▄▀░▀▀▀░▀░░▀ |
| |
| Created and Maintained By: |
| sk33z3r.eth |
| itsmonty.eth |
| |
+-------------------------------------------------+
EOF
echo "Updating LooPyGen CLI..."
docker pull $tag
echo "...done!"
}
usage() {
cat <<EOF
LooPyGen CLI Utility Script
Usage: $0 [command]
Commands:
update | Pull the latest image
secrets | Force remove the secrets Docker volume
{command} | Run a command inside the container
EOF
}
case $1 in
update) update;;
secrets) docker volume rm -f $name;;
-h|-help|help) usage;;
cid) # only mount local directory and set a new workdir inside the container
docker run -it --rm --name $name \
-w /scan \
-v $PWD:/scan \
$tag "$@"
;;
*) # run a command inside a self-destructing container
docker run -it --rm --name $name \
-v $name:/loopygen/.secrets \
-v $PWD/collections:/loopygen/collections:rw \
$tag "$@"
;;
esac