-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEVariables.cs
42 lines (36 loc) · 1.68 KB
/
EVariables.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
namespace ddb
{
public class EVariables
{
public EVariables()
{
MYSQL_ADRESS = Environment.GetEnvironmentVariable("MYSQL_ADRESS") ?? "";
MYSQL_PORT = Environment.GetEnvironmentVariable("MYSQL_PORT") ?? "3306";
MYSQL_USERNAME = Environment.GetEnvironmentVariable("MYSQL_USERNAME") ?? "";
MYSQL_PASSWORD = Environment.GetEnvironmentVariable("MYSQL_PASSWORD") ?? "";
MYSQL_DB_NAMES = Environment.GetEnvironmentVariable("MYSQL_DB_NAMES") ?? "";
DB_DUMP_BEGIN = Environment.GetEnvironmentVariable("DB_DUMP_BEGIN") ?? "";
MYSQL_EXTRA_OPTION = Environment.GetEnvironmentVariable("MYSQL_EXTRA_OPTION") ?? "";
if (Int32.TryParse(Environment.GetEnvironmentVariable("DB_DUMP_FREQ") ?? "", out int db_dump_freq))
DB_DUMP_FREQ = db_dump_freq;
else
DB_DUMP_FREQ = 1440;
if (Int32.TryParse(Environment.GetEnvironmentVariable("FILES_TO_KEEP") ?? "", out int file_to_keep))
FILES_TO_KEEP = file_to_keep;
else
FILES_TO_KEEP = 0;
TZ = Environment.GetEnvironmentVariable("TZ") ?? "";
}
public string MYSQL_ADRESS { get; set; }
public string MYSQL_PORT { get; set; }
public string MYSQL_USERNAME { get; set; }
public string MYSQL_PASSWORD { get; set; }
public string MYSQL_DB_NAMES { get; set; }
public string MYSQL_EXTRA_OPTION { get; set; }
public int DB_DUMP_FREQ { get; set; }
public string DB_DUMP_BEGIN { get; set; }
public int FILES_TO_KEEP { get; set; }
public string TZ { get; set; }
}
}