smazani
This commit is contained in:
@@ -1,135 +0,0 @@
|
||||
scriptLabel="[Script]"
|
||||
|
||||
# Runs the site backup dispatch with script logging.
|
||||
function cmdScriptBackup() {
|
||||
printDotText "Script" "Backup sites"
|
||||
printStart
|
||||
cmdBackupDispatch
|
||||
printFinish
|
||||
}
|
||||
|
||||
# Runs the MariaDB master full-dump script with script logging.
|
||||
function cmdScriptMariadbDump() {
|
||||
printDotText "Script" "MariaDB database dump"
|
||||
printStart
|
||||
cmdMariadbMasterDump
|
||||
printFinish
|
||||
}
|
||||
|
||||
# Runs the worker task observer with script logging.
|
||||
function cmdScriptWorkerObserver() {
|
||||
printDotText "Script" "Worker observer"
|
||||
printStart
|
||||
cmdWorkerObserver
|
||||
printFinish
|
||||
}
|
||||
|
||||
# Collects and pushes kube and lsphp metrics with script logging.
|
||||
function cmdScriptMetricKube() {
|
||||
printDotText "Script" "Metric KUBE"
|
||||
printStart
|
||||
metricKube
|
||||
metricLsphp
|
||||
printFinish
|
||||
}
|
||||
|
||||
# Collects and pushes per-site metrics with script logging.
|
||||
function cmdScriptMetricSites() {
|
||||
printDotText "Script" "Metric sites"
|
||||
printStart
|
||||
metricSites
|
||||
printFinish
|
||||
}
|
||||
|
||||
# Runs the AI diagnostic report with script logging.
|
||||
# [$1] (mode): report mode: short (default) or full.
|
||||
function cmdScriptDiagReportAi() {
|
||||
local mode
|
||||
mode=${1:-short}
|
||||
|
||||
printDotText "Script" "Diag report AI $mode"
|
||||
printStart
|
||||
diagRun "$mode"
|
||||
printFinish
|
||||
}
|
||||
|
||||
function cmdScriptMalwareCheck() {
|
||||
printDotText "Script" "Malware check"
|
||||
printStart
|
||||
|
||||
olsVhostsPath="$vhostsPath"
|
||||
|
||||
cmdMalwareFilesDelete list
|
||||
cmdMalwareUserDelete list
|
||||
cmdMalwareOptionsDelete list
|
||||
cmdMalwareCronDelete list
|
||||
|
||||
printFinish
|
||||
}
|
||||
|
||||
function cmdScriptMalwareRemove() {
|
||||
printDotText "Script" "Malware remove"
|
||||
printStart
|
||||
|
||||
olsVhostsPath="$vhostsPath"
|
||||
|
||||
cmdMalwareFilesDelete remove
|
||||
cmdMalwareUserDelete remove
|
||||
cmdMalwareOptionsDelete remove
|
||||
cmdMalwareCronDelete remove
|
||||
|
||||
printFinish
|
||||
}
|
||||
|
||||
function cmdScriptRun() {
|
||||
local option="$1"
|
||||
|
||||
printText "Output: $logPath/$option/${appDate}_$appTime.log"
|
||||
printRow
|
||||
|
||||
printFile="$logPath/$option/${appDate}_$appTime.log"
|
||||
local logFileOld="$logFile"
|
||||
logFile=""
|
||||
|
||||
case "$option" in
|
||||
backup)
|
||||
cmdScriptBackup
|
||||
;;
|
||||
mariadb-dump)
|
||||
cmdScriptMariadbDump
|
||||
;;
|
||||
worker-observer)
|
||||
cmdScriptWorkerObserver
|
||||
;;
|
||||
metric-kube)
|
||||
cmdScriptMetricKube
|
||||
;;
|
||||
metric-sites)
|
||||
cmdScriptMetricSites
|
||||
;;
|
||||
diag-report-ai-short)
|
||||
cmdScriptDiagReportAi "short"
|
||||
;;
|
||||
diag-report-ai-full)
|
||||
cmdScriptDiagReportAi "full"
|
||||
;;
|
||||
malware-remove)
|
||||
cmdScriptMalwareRemove
|
||||
;;
|
||||
unigma)
|
||||
cmdUnigma
|
||||
;;
|
||||
*)
|
||||
printFile=""
|
||||
logFile="$logFileOld"
|
||||
|
||||
printTitle " $scriptLabel"
|
||||
printRow
|
||||
printWarning "Unsupported or empty command: $action"
|
||||
cmdHelpScript
|
||||
;;
|
||||
esac
|
||||
|
||||
printFile=""
|
||||
logFile="$logFileOld"
|
||||
}
|
||||
Reference in New Issue
Block a user