-
Notifications
You must be signed in to change notification settings - Fork 0
/
chainmc
executable file
·56 lines (49 loc) · 1.16 KB
/
chainmc
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
# Set default values
config_path=""
log_path=""
type=""
# Parse command line arguments
while getopts ":c:l:t:" opt; do
case $opt in
c)
config_path="$OPTARG"
;;
l)
log_path="$OPTARG"
;;
t)
type="$OPTARG"
;;
\?)
echo "Invalid option -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
# Check if required arguments were provided
if [ -z "$config_path" ] || [ -z "$log_path" ] || [ -z "$type" ]; then
echo "Usage: $0 -c <config_path> -l <log_path> -t <type>"
exit 1
fi
# Convert relative paths to absolute paths
config_path=$(realpath "$config_path")
log_path=$(realpath "$log_path")
# Do something with the variables
echo "Config path: $config_path"
echo "Log path: $log_path"
echo "Type: $type"
PATH_CHAINMC=/home/varun/Desktop/CBMC_CHAIN_SIMULATION
cp $config_path $PATH_CHAINMC
# Check the type argument and do something
if [ "$type" == "cbmc" ]; then
python3 $PATH_CHAINMC/cbmc_for_chains.py
elif [ "$type" == "mc" ]; then
python3 $PATH_CHAINMC/mc_for_chains.py
else
echo "Error: Command is wrong"
fi