mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
21 lines
537 B
Go
21 lines
537 B
Go
package site
|
|
|
|
import (
|
|
"github.com/0xJacky/Nginx-UI/internal/helper"
|
|
"github.com/0xJacky/Nginx-UI/internal/nginx"
|
|
)
|
|
|
|
// GetSiteStatus returns the status of the site
|
|
func GetSiteStatus(name string) SiteStatus {
|
|
enabledFilePath := nginx.GetConfPath("sites-enabled", name)
|
|
if helper.FileExists(enabledFilePath) {
|
|
return SiteStatusEnabled
|
|
}
|
|
|
|
mantainanceFilePath := nginx.GetConfPath("sites-enabled", name+MaintenanceSuffix)
|
|
if helper.FileExists(mantainanceFilePath) {
|
|
return SiteStatusMaintenance
|
|
}
|
|
|
|
return SiteStatusDisabled
|
|
}
|