Skip to content

Commit

Permalink
fix: finding current task at progress server
Browse files Browse the repository at this point in the history
change from local progress file to progress server path
  • Loading branch information
pi-unnerup committed Oct 27, 2020
1 parent fc4def8 commit a619d5c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions attack/scripts/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ readonly -f info
#

find_current_task() {
local current_task
current_task=$(jq -r '.current_task' /progress.json)
local current_task scenario_id
scenario_id=$(yq -j r /tasks.yaml | jq -r '.name')
current_task=$(curl -s 127.0.0.1:51234?scenario=${scenario_id} | jq -r '.currentTask')
if [[ ${current_task} != "null" ]]; then
echo "${current_task}"
return
Expand All @@ -87,8 +88,9 @@ find_current_task() {
readonly -f find_current_task

check_if_task_set() {
local task
task=$(jq -r '.current_task' /progress.json)
local task scenario_id
scenario_id=$(yq -j r /tasks.yaml | jq -r '.name')
task=$(curl -s 127.0.0.1:51234?scenario=${scenario_id} | jq -r '.currentTask')
if [[ ${task} = "null" ]]; then
echo "You have not started a task yet. One can be set with 'start_task ...'. Would you like to continue anyway without starting a task? Enter '1' or '2'"
select yesno in "Yes" "No"; do
Expand Down

0 comments on commit a619d5c

Please sign in to comment.