fix: Use dir to allow mounting
All checks were successful
Build Docker / BuildSite (push) Successful in 1m11s

This commit is contained in:
Nathan Woodburn 2024-06-22 19:26:38 +10:00
parent d8b1ac3fb0
commit e693e5c489
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
3 changed files with 7 additions and 3 deletions

1
logs/monitor.log Normal file
View File

@ -0,0 +1 @@
Latest Check: Sat 22 Jun 2024 19:26:28 AEST

View File

@ -14,7 +14,7 @@ import (
"github.com/joho/godotenv" "github.com/joho/godotenv"
) )
const logFilePath = "monitor.log" const logFilePath = "logs/monitor.log"
const testFilePath = "test.sh" const testFilePath = "test.sh"
func main() { func main() {

View File

@ -1,5 +1,8 @@
#!/bin/bash #!/bin/bash
# Make log dir
mkdir -p logs
# Check if script has IP address as argument # Check if script has IP address as argument
if [ -z "$1" ]; then if [ -z "$1" ]; then
# Get Node IPs # Get Node IPs
@ -28,12 +31,12 @@ check_dig() {
else else
echo "$(date) - $1 failed for NODE_IP=$NODE_IP" echo "$(date) - $1 failed for NODE_IP=$NODE_IP"
# Save the failed IP # Save the failed IP
echo "$(date) - $1 failed for NODE_IP=$NODE_IP" >> monitor.log echo "$(date) - $1 failed for NODE_IP=$NODE_IP" >> logs/monitor.log
fi fi
} }
# Save test time # Save test time
echo "Latest Check: $(date)" >> monitor.log echo "Latest Check: $(date)" >> logs/monitor.log
# Loop over each IP and run the dig commands # Loop over each IP and run the dig commands