33 lines
763 B
Python
33 lines
763 B
Python
from flask import Flask, render_template
|
|
import ping3
|
|
|
|
# READ README YOU STUPID FUCK
|
|
|
|
app = Flask(__name__.split('.')[0])
|
|
def isUp(host: str) -> bool:
|
|
return bool(ping3.ping(host, timeout = 1))
|
|
|
|
@app.route('/')
|
|
def main():
|
|
url = "drath.cc"
|
|
links = ["isheatwork", "manga", "cloud", "movies"]
|
|
return render_template('index.html.j2', links=sorted(links), url=url)
|
|
|
|
@app.route('/status/funbox')
|
|
def funbox():
|
|
return str(isUp("192.168.1.1"))
|
|
|
|
@app.route('/status/proxmox')
|
|
def proxmox():
|
|
return str(isUp("10.0.1.2"))
|
|
|
|
@app.route('/status/opnsense')
|
|
def opnsense():
|
|
return str(isUp("10.0.1.1"))
|
|
|
|
@app.route('/status/server')
|
|
def server():
|
|
return str(isUp("10.0.1.200"))
|
|
|
|
if __name__ == '__main__':
|
|
app.run(host='0.0.0.0', port=8080, debug=True) |