mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 17:52:46 +01:00
logic changes
This commit is contained in:
@@ -1376,12 +1376,12 @@ check_service_status() {
|
|||||||
echo "Checking service $service_name status" >> "$setup_log" 2>&1
|
echo "Checking service $service_name status" >> "$setup_log" 2>&1
|
||||||
systemctl status $service_name >> "$setup_log" 2>&1
|
systemctl status $service_name >> "$setup_log" 2>&1
|
||||||
local status=$?
|
local status=$?
|
||||||
#true service is running false if not
|
#true if there is an issue with the service false if it is running properly
|
||||||
if [ $status -gt 0 ]; then
|
if [ $status -gt 0 ]; then
|
||||||
echo "$service_name is running" >> "$setup_log" 2>&1
|
echo "$service_name not is running" >> "$setup_log" 2>&1
|
||||||
status=1
|
status=1
|
||||||
else
|
else
|
||||||
echo "$service_name is not running" >> "$setup_log" 2>&1
|
echo "$service_name is running" >> "$setup_log" 2>&1
|
||||||
status=0
|
status=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1439,7 +1439,7 @@ salt_checkin() {
|
|||||||
echo "Stopping service $service" >> "$setup_log" 2>&1
|
echo "Stopping service $service" >> "$setup_log" 2>&1
|
||||||
systemctl stop "$service" >> "$setup_log" 2>&1
|
systemctl stop "$service" >> "$setup_log" 2>&1
|
||||||
LOOP_COUNT=0
|
LOOP_COUNT=0
|
||||||
while (( $(check_service_status $service) )); do
|
while ! (( $(check_service_status $service) )); do
|
||||||
echo "$service still running" >> "$setup_log" 2>&1
|
echo "$service still running" >> "$setup_log" 2>&1
|
||||||
if [ $LOOP_COUNT -gt 60 ]; then
|
if [ $LOOP_COUNT -gt 60 ]; then
|
||||||
echo "$service could not be stopped in 60 seconds, exiting" >> "$setup_log" 2>&1
|
echo "$service could not be stopped in 60 seconds, exiting" >> "$setup_log" 2>&1
|
||||||
@@ -1456,7 +1456,7 @@ salt_checkin() {
|
|||||||
echo "Starting service $service" >> "$setup_log" 2>&1
|
echo "Starting service $service" >> "$setup_log" 2>&1
|
||||||
systemctl start "$service" >> "$setup_log" 2>&1
|
systemctl start "$service" >> "$setup_log" 2>&1
|
||||||
LOOP_COUNT=0
|
LOOP_COUNT=0
|
||||||
while ! (( $(check_service_status $service) )); do
|
while (( $(check_service_status $service) )); do
|
||||||
echo "$service still not running" >> "$setup_log" 2>&1
|
echo "$service still not running" >> "$setup_log" 2>&1
|
||||||
if [ $LOOP_COUNT -gt 60 ]; then
|
if [ $LOOP_COUNT -gt 60 ]; then
|
||||||
echo "$service could not be started in 60 seconds, exiting" >> "$setup_log" 2>&1
|
echo "$service could not be started in 60 seconds, exiting" >> "$setup_log" 2>&1
|
||||||
|
|||||||
Reference in New Issue
Block a user