Skip to content

Commit

Permalink
update to allow for skipping GSAD startup
Browse files Browse the repository at this point in the history
  • Loading branch information
immauss committed Dec 12, 2024
1 parent f75e42c commit ce25664
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 8 additions & 3 deletions scripts/healthcheck.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
SKIPGSAD=${SKIPGSAD:-false}
FUNC=$(cat /usr/local/etc/running-as)
ContainerShutdown() {
# Flush logs;
Expand Down Expand Up @@ -39,8 +40,10 @@ case $FUNC in
nmap -p 9390 localhost| grep -qs "9390.*open" || exit 1
;;
gsad)
#gsad should be listening on 9392
curl -f http://localhost:9392/ || curl -kf https://localhost:9392/ || exit 1
if [ "$SKIPGSAD" == "false" ]; then
#gsad should be listening on 9392
curl -f http://localhost:9392/ || curl -kf https://localhost:9392/ || exit 1
fi
;;
redis)
redis-cli -s /run/redis/redis.sock ping || exit 1
Expand Down Expand Up @@ -80,8 +83,10 @@ case $FUNC in
SERVICE="$SERVICE openvas\n"
fi
# gsad
curl -f http://localhost:9392/ || curl -kf https://localhost:9392/ || FAIL=3
if [ "$SKIPGSAD" == "false" ]; then
curl -f http://localhost:9392/ || curl -kf https://localhost:9392/ || FAIL=3
if [ $FAIL -eq 3 ]; then SERVICE="$SERVICE gsad\n"; fi
fi
# redis
redis-cli -s /run/redis/redis.sock ping || FAIL=4
if [ $FAIL -eq 4 ]; then SERVICE="$SERVICE redis\n"; fi
Expand Down
7 changes: 3 additions & 4 deletions scripts/single.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if [ $GVMD_ARGS == "blank" ]; then
GVMD_ARGS='--'
fi
if [ "$DEBUG" == "true" ]; then
for var in USERNAME PASSWORD RELAYHOST SMTPPORT REDISDBS QUIET CREATE_EMPTY_DATABASE SKIPSYNC RESTORE DEBUG HTTPS GSATIMEOUT ; do
for var in USERNAME PASSWORD RELAYHOST SMTPPORT REDISDBS QUIET CREATE_EMPTY_DATABASE SKIPSYNC RESTORE DEBUG HTTPS GSATIMEOUT SKIPGSAD; do
echo "$var = ${var}"
done
fi
Expand All @@ -44,8 +44,6 @@ function DBCheck {
echo 0
fi
}
# Need something new here to check for existing 'old' /data and fix all the links.
# maybe an option passed to fs-setup?

# 21.4.4-01 and up uses a slightly different structure on /data, so we look for the old, and correct if we find it.
if [ -f /data/var-log/gvmd.log ]; then
Expand Down Expand Up @@ -473,7 +471,8 @@ echo "Starting Open Scanner Protocol daemon for OpenVAS..."
# But if we leave the socket owned by root, gvmd can not communicate with it.
chgrp gvm /var/run/ospd/ospd.sock
chgrp gvm /var/run/ospd/ospd-openvas.sock
if [ SKIPGSAD="false"]; then

if [ SKIPGSAD == "false" ]; then
echo "Starting Greenbone Security Assistant..."
#su -c "gsad --verbose --http-only --no-redirect --port=9392" gvm
if [ $HTTPS == "true" ]; then
Expand Down

0 comments on commit ce25664

Please sign in to comment.