mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge pull request #6157 from Security-Onion-Solutions/foxtrot
Fix preflight script on centos
This commit is contained in:
@@ -28,26 +28,51 @@ fi
|
|||||||
|
|
||||||
check_default_repos() {
|
check_default_repos() {
|
||||||
local ret_code=0
|
local ret_code=0
|
||||||
|
local repo_str=' Checking OS default repos with '
|
||||||
|
if [[ $script_run == true ]]; then
|
||||||
|
printf '%s' "$repo_str"
|
||||||
|
else
|
||||||
|
printf '%s' "$repo_str" | tee -a "$preflight_log"
|
||||||
|
fi
|
||||||
|
|
||||||
printf ' Checking OS default repos with ' | tee -a "$preflight_log"
|
|
||||||
if [[ $OS == 'centos' ]]; then
|
if [[ $OS == 'centos' ]]; then
|
||||||
|
if [[ $script_run == true ]]; then
|
||||||
|
printf '%s' 'yum update.'
|
||||||
|
else
|
||||||
printf '%s' 'yum update.' | tee -a "$preflight_log"
|
printf '%s' 'yum update.' | tee -a "$preflight_log"
|
||||||
|
fi
|
||||||
echo "" >> "$preflight_log"
|
echo "" >> "$preflight_log"
|
||||||
yum -y check-update >> $preflight_log 2>&1
|
yum -y check-update >> $preflight_log 2>&1
|
||||||
ret_code=$?
|
ret_code=$?
|
||||||
|
if [[ $ret_code == 0 || $ret_code == 100 ]]; then
|
||||||
|
printf '%s\n' ' SUCCESS'
|
||||||
|
ret_code=0
|
||||||
|
else
|
||||||
|
printf '%s\n' ' FAILURE'
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [[ $script_run == true ]]; then
|
||||||
|
printf '%s' 'apt update.'
|
||||||
else
|
else
|
||||||
printf '%s' 'apt update.' | tee -a "$preflight_log"
|
printf '%s' 'apt update.' | tee -a "$preflight_log"
|
||||||
|
fi
|
||||||
echo "" >> "$preflight_log"
|
echo "" >> "$preflight_log"
|
||||||
retry 50 10 "apt-get -y update" >> $preflight_log 2>&1
|
retry 50 10 "apt-get -y update" >> $preflight_log 2>&1
|
||||||
ret_code=$?
|
ret_code=$?
|
||||||
|
[[ $ret_code == 0 ]] && printf '%s\n' ' SUCCESS' || printf '%s\n' ' FAILURE'
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ $ret_code == 0 ]] && printf '%s\n' ' SUCCESS' || printf '%s\n' ' FAILURE'
|
|
||||||
return $ret_code
|
return $ret_code
|
||||||
}
|
}
|
||||||
|
|
||||||
check_new_repos() {
|
check_new_repos() {
|
||||||
printf ' Checking repo URLs added by setup.' | tee -a "$preflight_log"
|
local repo_url_str=' Checking repo URLs added by setup.'
|
||||||
|
if [[ $script_run == true ]]; then
|
||||||
|
printf '%s' "$repo_url_str"
|
||||||
|
else
|
||||||
|
printf '%s' "$repo_url_str" | tee -a "$preflight_log"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $OS == 'centos' ]]; then
|
if [[ $OS == 'centos' ]]; then
|
||||||
local repo_arr=(
|
local repo_arr=(
|
||||||
@@ -76,7 +101,12 @@ check_new_repos() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
check_misc_urls() {
|
check_misc_urls() {
|
||||||
printf ' Checking various other URLs used by setup.' | tee -a "$preflight_log"
|
local misc_url_str=' Checking various other URLs used by setup.'
|
||||||
|
if [[ $script_run == true ]]; then
|
||||||
|
printf '%s' "$misc_url_str"
|
||||||
|
else
|
||||||
|
printf '%s' "$misc_url_str" | tee -a "$preflight_log"
|
||||||
|
fi
|
||||||
|
|
||||||
local so_version
|
local so_version
|
||||||
so_version=$(cat ../VERSION)
|
so_version=$(cat ../VERSION)
|
||||||
|
|||||||
Reference in New Issue
Block a user