asd
This commit is contained in:
parent
15d14d5099
commit
39b0ed19ae
@ -1 +1 @@
|
|||||||
gcc main.c -lcurl -Wall -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -ldbus-1
|
gcc main.c config.c -lcurl -Wall -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -ldbus-1
|
||||||
|
4
compile_flags.txt
Normal file
4
compile_flags.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
-lcurl
|
||||||
|
-I/usr/include/dbus-1.0
|
||||||
|
-I/usr/lib/dbus-1.0/include
|
||||||
|
-ldbus-1
|
20
main.c
20
main.c
@ -4,6 +4,8 @@
|
|||||||
#include<string.h>
|
#include<string.h>
|
||||||
#include<dbus/dbus.h>
|
#include<dbus/dbus.h>
|
||||||
#include<stdbool.h>
|
#include<stdbool.h>
|
||||||
|
#include"config.h"
|
||||||
|
|
||||||
|
|
||||||
int gotify_message(char *,char *,char *);
|
int gotify_message(char *,char *,char *);
|
||||||
int systemdCall(DBusConnection *,char *, char *);
|
int systemdCall(DBusConnection *,char *, char *);
|
||||||
@ -11,6 +13,7 @@ int checkIsActive(DBusConnection *connection, char *service_name);
|
|||||||
int systemdUnitCall(DBusConnection *connection,char *target,char *method,char *param,char **result);
|
int systemdUnitCall(DBusConnection *connection,char *target,char *method,char *param,char **result);
|
||||||
int GetSendStatus(DBusConnection *connection,char *objectpath);
|
int GetSendStatus(DBusConnection *connection,char *objectpath);
|
||||||
int checkState(char *ServiceName,char *result);
|
int checkState(char *ServiceName,char *result);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*sytemctl show gotify-server | grep PID
|
*sytemctl show gotify-server | grep PID
|
||||||
*sudo busctl tree org.freedesktop.systemd1 > get object paths
|
*sudo busctl tree org.freedesktop.systemd1 > get object paths
|
||||||
@ -26,7 +29,6 @@ typedef struct service
|
|||||||
|
|
||||||
int main(int argc,char *argv[])
|
int main(int argc,char *argv[])
|
||||||
{
|
{
|
||||||
|
|
||||||
//int i;
|
//int i;
|
||||||
//Service serviceSys;
|
//Service serviceSys;
|
||||||
DBusConnection *connection=NULL;
|
DBusConnection *connection=NULL;
|
||||||
@ -76,6 +78,20 @@ int main(int argc,char *argv[])
|
|||||||
{
|
{
|
||||||
fprintf(stderr,"requires a command\n--\n# getSendStatus [objectpath]\n# listUnits\n#set token with GOTIFY_TOKEN=\"sjdfoiasfd\"\n--\n");
|
fprintf(stderr,"requires a command\n--\n# getSendStatus [objectpath]\n# listUnits\n#set token with GOTIFY_TOKEN=\"sjdfoiasfd\"\n--\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *str_entry[64];
|
||||||
|
int i=0;
|
||||||
|
|
||||||
|
str_entry[0]="asdhfasfd";
|
||||||
|
str_entry[1]="asdhfasfd";
|
||||||
|
str_entry[3]="asdhfasfd";
|
||||||
|
for(i=0;i<64;i++)
|
||||||
|
{
|
||||||
|
str_entry[i]="empty";
|
||||||
|
printf("test string:%s\n",str_entry[i]);
|
||||||
|
}
|
||||||
|
loadConfig("config",str_entry,10);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*interactive
|
/*interactive
|
||||||
@ -455,6 +471,8 @@ int systemdUnitCall(DBusConnection *connection,char *target,char *method,char *p
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
int checkIsActive(DBusConnection *connection, char *service_name)
|
int checkIsActive(DBusConnection *connection, char *service_name)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user