mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
fix merge conflicts
This commit is contained in:
@@ -303,6 +303,7 @@ retry() {
|
||||
cmd=$3
|
||||
expectedOutput=$4
|
||||
attempt=0
|
||||
local exitcode=0
|
||||
while [[ $attempt -lt $maxAttempts ]]; do
|
||||
attempt=$((attempt+1))
|
||||
echo "Executing command with retry support: $cmd"
|
||||
@@ -322,7 +323,29 @@ retry() {
|
||||
sleep $sleepDelay
|
||||
done
|
||||
echo "Command continues to fail; giving up."
|
||||
return 1
|
||||
return $exitcode
|
||||
}
|
||||
|
||||
run_check_net_err() {
|
||||
local cmd=$1
|
||||
local err_msg=${2:-"Unknown error occured, please check /root/$WHATWOULDYOUSAYYAHDOHERE.log for details."} # Really need to rename that variable
|
||||
local no_retry=$3
|
||||
|
||||
local exit_code
|
||||
if [[ -z $no_retry ]]; then
|
||||
retry 5 60 "$cmd"
|
||||
exit_code=$?
|
||||
else
|
||||
eval "$cmd"
|
||||
exit_code=$?
|
||||
fi
|
||||
|
||||
if [[ $exit_code -ne 0 ]]; then
|
||||
ERR_HANDLED=true
|
||||
[[ -z $no_retry ]] || echo "Command failed with error $exit_code"
|
||||
echo "$err_msg"
|
||||
exit $exit_code
|
||||
fi
|
||||
}
|
||||
|
||||
set_os() {
|
||||
|
||||
Reference in New Issue
Block a user