remove not needed anymore check_status () function
This commit is contained in:
parent
f22f3f9504
commit
881542f9d3
@ -46,8 +46,6 @@ namespace Yggtk {
|
|||||||
|
|
||||||
Object(application: application);
|
Object(application: application);
|
||||||
|
|
||||||
check_status (service_state_switch);
|
|
||||||
|
|
||||||
ip_entry.notify["text"].connect (() => {
|
ip_entry.notify["text"].connect (() => {
|
||||||
|
|
||||||
if (ip_entry.text != "") {
|
if (ip_entry.text != "") {
|
||||||
@ -82,53 +80,6 @@ namespace Yggtk {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int check_status (Switch status) {
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
string yggstatus;
|
|
||||||
Process.spawn_command_line_sync ("rc-service yggdrasil status", out yggstatus);
|
|
||||||
|
|
||||||
if (yggstatus == "bash: rc-service: command not found\n") {
|
|
||||||
|
|
||||||
Process.spawn_command_line_sync ("systemctl status yggdrasil | grep running -c", out yggstatus);
|
|
||||||
|
|
||||||
if (yggstatus == "0") {
|
|
||||||
|
|
||||||
status.state_set (false);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
status.state_set (true);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (yggstatus == " * status: stopped\n") {
|
|
||||||
|
|
||||||
status.state_set (false);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
status.state_set (true);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Error e) {
|
|
||||||
|
|
||||||
print ("Error check status: %s\n", e.message);
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int parse (string yggconf, Entry ip) {
|
int parse (string yggconf, Entry ip) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user