summaryrefslogtreecommitdiff
path: root/genesis_check.sh
blob: d1ab7027fc1fbdd015109e71b2bdb44e9815fb70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
mkdir -p /var/log/genesis_uptime

declare -A services=(
  [radio]="https://genesis-radio.net"
  [mastodon]="https://chatwithus.live"
  [minio]="https://console.sshjunkie.com"
  [azura]="https://portal.genesishostingtechnologies.com"
  [teamtalk]="http://tt.themediahub.org"
  [directadmin]="https://da.genesishostingtechnologies.com"
)

timestamp=$(date -u +"%Y-%m-%dT%H:%M:%S")

for service in "${!services[@]}"
do
  url=${services[$service]}
  curl --head --silent --max-time 10 "$url" >/dev/null
  if [ $? -eq 0 ]; then
    echo "$timestamp,up" >> "/var/log/genesis_uptime/$service.log"
  else
    echo "$timestamp,down" >> "/var/log/genesis_uptime/$service.log"
  fi
done