generated from nathanwoodburn/go-webserver-template
fix: Use dir to allow mounting
All checks were successful
Build Docker / BuildSite (push) Successful in 1m11s
All checks were successful
Build Docker / BuildSite (push) Successful in 1m11s
This commit is contained in:
parent
d8b1ac3fb0
commit
e693e5c489
1
logs/monitor.log
Normal file
1
logs/monitor.log
Normal file
@ -0,0 +1 @@
|
||||
Latest Check: Sat 22 Jun 2024 19:26:28 AEST
|
2
main.go
2
main.go
@ -14,7 +14,7 @@ import (
|
||||
"github.com/joho/godotenv"
|
||||
)
|
||||
|
||||
const logFilePath = "monitor.log"
|
||||
const logFilePath = "logs/monitor.log"
|
||||
const testFilePath = "test.sh"
|
||||
|
||||
func main() {
|
||||
|
7
test.sh
7
test.sh
@ -1,5 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Make log dir
|
||||
mkdir -p logs
|
||||
|
||||
# Check if script has IP address as argument
|
||||
if [ -z "$1" ]; then
|
||||
# Get Node IPs
|
||||
@ -28,12 +31,12 @@ check_dig() {
|
||||
else
|
||||
echo "$(date) - $1 failed for NODE_IP=$NODE_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
|
||||
}
|
||||
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user