Created
November 22, 2022 15:05
-
-
Save riskiwah/e2e734e71defe41db81ebfa97e9802bb to your computer and use it in GitHub Desktop.
DIY service up, suitable if combine with cron
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, subprocess | |
resp = requests.get("https://riskiwah.xyz") | |
if resp.status_code == 502: | |
print("Your Landing Pages is Down!!") | |
subprocess.call("docker-compose up -d", shell=True, cwd="/home/dietpi/code/wireguard-way/") | |
else: | |
print("Your Landing Pages is Up!!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" https://riskiwah.xyz) | |
if [ "$STATUS_CODE" == 502 ]; then | |
echo "Your Landing Pages is Down!!" | |
docker-compose -f code/wireguard-way/docker-compose.yaml up -d | |
else | |
echo "Your Landing Pages is Up!!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment