diff --git a/comile.sh b/comile.sh index 93c580a..881505a 100644 --- a/comile.sh +++ b/comile.sh @@ -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 diff --git a/compile_flags.txt b/compile_flags.txt new file mode 100644 index 0000000..92c7f39 --- /dev/null +++ b/compile_flags.txt @@ -0,0 +1,4 @@ +-lcurl +-I/usr/include/dbus-1.0 +-I/usr/lib/dbus-1.0/include +-ldbus-1 diff --git a/main.c b/main.c index a942510..d55b05d 100644 --- a/main.c +++ b/main.c @@ -4,6 +4,8 @@ #include #include #include +#include"config.h" + int gotify_message(char *,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 GetSendStatus(DBusConnection *connection,char *objectpath); int checkState(char *ServiceName,char *result); + /* *sytemctl show gotify-server | grep PID *sudo busctl tree org.freedesktop.systemd1 > get object paths @@ -26,7 +29,6 @@ typedef struct service int main(int argc,char *argv[]) { - //int i; //Service serviceSys; 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"); } + + 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; } /*interactive @@ -455,6 +471,8 @@ int systemdUnitCall(DBusConnection *connection,char *target,char *method,char *p } return 0; } + + /* int checkIsActive(DBusConnection *connection, char *service_name) {