mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
move functions up
This commit is contained in:
@@ -195,6 +195,51 @@ check_pass_match() {
|
||||
fi
|
||||
}
|
||||
|
||||
check_service_status() {
|
||||
|
||||
local service_name=$1
|
||||
echo "Checking service $service_name status" >> "$setup_log" 2>&1
|
||||
systemctl status $service_name >> "$setup_log" 2>&1
|
||||
local status=$?
|
||||
#true if there is an issue with the service false if it is running properly
|
||||
if [ $status -gt 0 ]; then
|
||||
echo "$service_name is not running" >> "$setup_log" 2>&1
|
||||
echo 1;
|
||||
else
|
||||
echo "$service_name is running" >> "$setup_log" 2>&1
|
||||
echo 0;
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
check_salt_master_status() {
|
||||
echo "Checking if we can talk to the salt master" >> "$setup_log" 2>&1
|
||||
salt-call state.show_top > /dev/null 2>&1
|
||||
local status=$?
|
||||
#true if there is an issue talking to salt master
|
||||
if [ $status -gt 0 ]; then
|
||||
echo 1;
|
||||
else
|
||||
echo "Can talk to salt master" >> "$setup_log" 2>&1
|
||||
echo 0;
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
check_salt_minion_status() {
|
||||
echo "Checking if the salt minion will respond to jobs" >> "$setup_log" 2>&1
|
||||
salt "$MINION_ID" test.ping >> "$setup_log" 2>&1
|
||||
local status=$?
|
||||
#true if there is an issue getting a job response from the minion
|
||||
if [ $status -gt 0 ]; then
|
||||
echo 1;
|
||||
else
|
||||
echo "Received job response from salt minion" >> "$setup_log" 2>&1
|
||||
echo 0;
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
check_soremote_pass() {
|
||||
check_pass_match "$SOREMOTEPASS1" "$SOREMOTEPASS2" "SCMATCH"
|
||||
}
|
||||
@@ -1370,51 +1415,6 @@ saltify() {
|
||||
|
||||
}
|
||||
|
||||
check_service_status() {
|
||||
|
||||
local service_name=$1
|
||||
echo "Checking service $service_name status" >> "$setup_log" 2>&1
|
||||
systemctl status $service_name >> "$setup_log" 2>&1
|
||||
local status=$?
|
||||
#true if there is an issue with the service false if it is running properly
|
||||
if [ $status -gt 0 ]; then
|
||||
echo "$service_name is not running" >> "$setup_log" 2>&1
|
||||
echo 1;
|
||||
else
|
||||
echo "$service_name is running" >> "$setup_log" 2>&1
|
||||
echo 0;
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
check_salt_master_status() {
|
||||
echo "Checking if we can talk to the salt master" >> "$setup_log" 2>&1
|
||||
salt-call state.show_top > /dev/null 2>&1
|
||||
local status=$?
|
||||
#true if there is an issue talking to salt master
|
||||
if [ $status -gt 0 ]; then
|
||||
echo 1;
|
||||
else
|
||||
echo "Can talk to salt master" >> "$setup_log" 2>&1
|
||||
echo 0;
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
check_salt_minion_status() {
|
||||
echo "Checking if the salt minion will respond to jobs" >> "$setup_log" 2>&1
|
||||
salt "$MINION_ID" test.ping >> "$setup_log" 2>&1
|
||||
local status=$?
|
||||
#true if there is an issue getting a job response from the minion
|
||||
if [ $status -gt 0 ]; then
|
||||
echo 1;
|
||||
else
|
||||
echo "Received job response from salt minion" >> "$setup_log" 2>&1
|
||||
echo 0;
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
salt_checkin() {
|
||||
|
||||
case "$install_type" in
|
||||
|
||||
Reference in New Issue
Block a user