File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ get_account_info() {
34
34
get_participation_expiration_eta () {
35
35
local active_key_last_valid_round=$1
36
36
local last_committed_block=$2
37
+
38
+ if ! [[ $1 =~ ^[0-9]+$ ]] || ! [[ $2 =~ ^[0-9]+$ ]]; then
39
+ echo " Both arguments must be integers. Exiting."
40
+ exit 1
41
+ fi
42
+
37
43
local current_key_blocks_remaining=$(( active_key_last_valid_round - last_committed_block))
38
44
local remaining_seconds
39
45
local current_timestamp
@@ -57,6 +63,12 @@ display_participation_key_information() {
57
63
last_committed_block=$( get_last_committed_block)
58
64
59
65
active_key_last_valid_round=$( docker exec -it " ${container_id} " bash -c ' goal account listpartkeys' | awk ' $1=="yes" {print $6}' | tr -cd ' [:digit:]' )
66
+
67
+ if [[ -z " ${active_key_last_valid_round} " ]]; then
68
+ echo " Participation status: No active participation key found."
69
+ return 1
70
+ fi
71
+
60
72
existing_expiration_date=$( get_participation_expiration_eta " ${active_key_last_valid_round} " " ${last_committed_block} " )
61
73
62
74
echo " Participation status: $( docker exec -it " ${container_id} " bash -c ' goal account dump -a ' " ${account_address} " ' | jq -r ' \' ' if (.onl == 1) then "online" else "offline" end' \' ' ' ) "
Original file line number Diff line number Diff line change @@ -794,7 +794,7 @@ add_update_jitter() {
794
794
# Generate a random number between 0 and 2, and add +1 to shift the range to 1-3
795
795
random_hour=$(( RANDOM % 3 + 1 ))
796
796
797
- new_cron_schedule=" swarm.cronjob.schedule= ${random_minute} */${random_hour} * * *"
797
+ new_cron_schedule=" ${random_minute} */${random_hour} * * *"
798
798
sed -i -E " s|(swarm.cronjob.schedule=).*|\1${new_cron_schedule} |" " ${schedule_filename} "
799
799
}
800
800
You can’t perform that action at this time.
0 commit comments