Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EV Charging Attack Analysis and Detection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SEACOP
EV Charging Attack Analysis and Detection
Commits
41119492
Commit
41119492
authored
11 months ago
by
Dustin Kern
Browse files
Options
Downloads
Patches
Plain Diff
run script
parent
d0a8eeaf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
run_wattson.sh
+62
-0
62 additions, 0 deletions
run_wattson.sh
with
62 additions
and
0 deletions
run_wattson.sh
0 → 100644
+
62
−
0
View file @
41119492
#!/bin/bash
#sudo bash run_wattson.sh
if
[
"
$(
id
-u
)
"
-ne
0
]
;
then
echo
'This script must be run by root'
>
&2
exit
1
fi
mkdir
-p
logs
cd
..
#change /home/dk/git/wattson/scenarios/powerowl_example/extensions.yml for scaling
#change /home/dk/git/wattson/wattson/apps/script_controller/scripts/ev_atks.py for attack case setting
#change /home/dk/git/wattson/scenarios/powerowl_example/extensions/power-profiles.yml for start_datetime
init_scale
=
1.0
sed
-E
-i
"s/init
\_
load
\_
scaling: [0-9
\.
]+/init_load_scaling:
$init_scale
/g"
wattson/scenarios/powerowl_example/extensions.yml
echo
"year"
sed
-E
-i
"s/self
\.
case =
\"\w
+
\"
/self.case =
\"
base
\"
/g"
wattson/wattson/apps/script_controller/scripts/ev_atks.py
sed
-E
-i
"s/start
\_
datetime:
\"
.+
\"
/start_datetime:
\"
2023-01-01 00:00:00
\"
/g"
wattson/scenarios/powerowl_example/extensions/power-profiles.yml
sed
-E
-i
"s/cp_num_mean=.+ #use/cp_num_mean=85 #use/g"
wattson/scenarios/powerowl_example/extensions/ev_charging_extension.py
sed
-E
-i
"s/cp_num_stdev=.+ #use/cp_num_stdev=10 #use/g"
wattson/scenarios/powerowl_example/extensions/ev_charging_extension.py
log_out
=
"wattson/logs/log_base_out.log"
log_err
=
"wattson/logs/log_base_err.log"
python3
-m
wattson wattson/scenarios/powerowl_example
--no-cli
--seed
5
>>
$log_out
2>>
$log_err
l_name
=
$(
readlink
-f
wattson-artifacts/latest
)
new_name
=
"wattson-artifacts/year_powerowl_example"
mv
$l_name
$new_name
chown
-R
$USER
$new_name
echo
"attacks"
sed
-E
-i
"s/self
\.
case =
\"\w
+
\"
/self.case =
\"
atk
\"
/g"
wattson/wattson/apps/script_controller/scripts/ev_atks.py
sed
-E
-i
"s/start
\_
datetime:
\"
.+
\"
/start_datetime:
\"
2023-11-29 00:00:00
\"
/g"
wattson/scenarios/powerowl_example/extensions/power-profiles.yml
for
s
in
{
1..5
}
do
#for p in 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
for
p
in
1.0 0.8 0.6 0.4 0.2
do
echo
"
$s
$p
"
sed
-E
-i
"s/attack_p: [
\.
0-9]+/attack_p:
$p
/g"
wattson/scenarios/powerowl_example/extensions/script-controller.yml
sed
-E
-i
"s/attack_seed: [0-9]+/attack_seed:
$s
/g"
wattson/scenarios/powerowl_example/extensions/script-controller.yml
log_out
=
"wattson/logs/log_"
$s
"_"
$p
"_out.log"
log_err
=
"wattson/logs/log_"
$s
"_"
$p
"_err.log"
python3
-m
wattson wattson/scenarios/powerowl_example
--no-cli
--seed
5
>>
$log_out
2>>
$log_err
l_name
=
$(
readlink
-f
wattson-artifacts/latest
)
new_name
=
"wattson-artifacts/atk_"
$s
"_"
$p
"_powerowl_example"
mv
$l_name
$new_name
echo
"
$s
$p
$l_name
$new_name
"
>>
wattson/logs/log_file.log
chown
-R
$USER
$new_name
done
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment