forked from Cytmo/waf-prowler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·73 lines (66 loc) · 2.1 KB
/
run.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
#!/bin/bash
# Display options menu
echo "Please choose whether to enable profiling (cProfile):"
echo "1. Enable profiling"
echo "2. Disable profiling"
read -p "Enter option [1-2]: " profiling_choice
echo "Please choose how to run waf-prowler:"
echo "1. Run waf-prowler with memory..."
echo "2. Run waf-prowler on test data with shortcut disabled..."
echo "3. Run waf-prowler without memory and disable shortcut..."
echo "4. Run waf-prowler without memory and with reinforcement learning..."
echo "5. Run waf-prowler on test data..."
echo "6. Clean up..."
echo "6. Exit"
read -p "Enter option [1-6]: " execution_choice
# Construct command based on choices
if [ "$profiling_choice" -eq 1 ]; then
profile_command="python -m cProfile -o profile.stats"
snakeviz_command="&& python -m snakeviz profile.stats --server"
else
profile_command="python3"
snakeviz_command=""
fi
# Build the command to execute
case $execution_choice in
1)
echo "Running waf-prowler with memory..."
command="$profile_command main.py -m $snakeviz_command"
;;
2)
echo "Running waf-prowler on test data with shortcut disabled..."
command="$profile_command main.py -m --test --disable-shortcut $snakeviz_command"
;;
3)
echo "Running waf-prowler without memory and disable shortcut..."
command="$profile_command main.py -m --disable-memory -ds $snakeviz_command"
;;
4)
echo "Running waf-prowler without memory and with reinforcement learning..."
command="$profile_command main.py -m --disable-memory --rl $snakeviz_command"
echo $command
;;
5)
echo "Running waf-prowler on test data..."
command="$profile_command main.py -m --test $snakeviz_command"
;;
6)
echo "Cleaning up..."
./clean.sh
exit 0
;;
7)
echo "Exiting the program"
exit 0
;;
*)
echo "Invalid option. Please choose 1, 2, 3, 4, 5, or 6."
exit 1
;;
esac
# Execute the command
if [ -n "$profile_command" ]; then
eval "$command"
else
eval "$command"
fi