Initial commit
This commit is contained in:
commit
77d35ff965
51 changed files with 5591 additions and 0 deletions
28
Pages/Setup/Scripts.cshtml.cs
Normal file
28
Pages/Setup/Scripts.cshtml.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace PlanTempusAdmin.Pages.Setup;
|
||||
|
||||
public class ScriptsModel : PageModel
|
||||
{
|
||||
private readonly IWebHostEnvironment _environment;
|
||||
|
||||
public string BashScript { get; set; } = string.Empty;
|
||||
|
||||
public ScriptsModel(IWebHostEnvironment environment)
|
||||
{
|
||||
_environment = environment;
|
||||
}
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
var scriptPath = Path.Combine(_environment.ContentRootPath, "Scripts", "forgejo-backup.sh");
|
||||
if (System.IO.File.Exists(scriptPath))
|
||||
{
|
||||
BashScript = System.IO.File.ReadAllText(scriptPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
BashScript = "# Script not found at: " + scriptPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue