mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-15 09:46:11 +01:00
install log in py
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
import json
|
||||
import time
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
class InstallLog:
|
||||
fileName = "/var/log/installLogs.txt"
|
||||
|
||||
currentPercent = '10'
|
||||
LogURL = 'http://cloud.cyberpanel.net:8000/servers/RecvData'
|
||||
ServerIP = ''
|
||||
|
||||
@staticmethod
|
||||
def writeToFile(message):
|
||||
@@ -22,3 +27,6 @@ class InstallLog:
|
||||
file.writelines("[" + time.strftime(
|
||||
"%m.%d.%Y_%H-%M-%S") + "] " + message + "\n")
|
||||
file.close()
|
||||
|
||||
finalData = json.dumps({'ipAddress': InstallLog.ServerIP, "InstallCyberPanelStatus": message})
|
||||
requests.post(InstallLog.LogURL, data=finalData, verify=False)
|
||||
|
||||
Reference in New Issue
Block a user