X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=appimage%2Fctdlvisor.c;h=6257947644987840f9d4f58bc9a2624493909d4e;hb=758608a1a004b60db17c960263036a73f5776adf;hp=cedc2a4c49d2c285d5560e82f4014b38b5613d04;hpb=55ccbdf1cbb55d5c190072dbba32394fcf171d60;p=citadel.git diff --git a/appimage/ctdlvisor.c b/appimage/ctdlvisor.c index cedc2a4c4..625794764 100644 --- a/appimage/ctdlvisor.c +++ b/appimage/ctdlvisor.c @@ -149,6 +149,23 @@ pid_t start_webcits() { } +void test_binary_compatibility(void) { + char cmd[1024]; + int ret; + fprintf(stderr, "ctdlvisor: testing compatibility...\n"); + sprintf(cmd, "%s/usr/local/citadel/citserver -c", getenv("APPDIR")); + ret = system(cmd); + if (ret) { + fprintf(stderr, "ctdlvisor: this appimage cannot run on your system.\n" + " The reason may be indicated by any error messages appearing above.\n"); + } + else { + fprintf(stderr, "ctdlvisor: this appimage appears to be compatible with your system.\n"); + } + exit(ret); +} + + void main_loop(void) { int status; pid_t who_exited; @@ -302,7 +319,7 @@ int main(int argc, char **argv) { fprintf(stderr, "oops, this is not implemented yet\n"); } else if (!strcasecmp(argv[optind], "test")) { - fprintf(stderr, "oops, this is not implemented yet\n"); + test_binary_compatibility(); } else if (!strcasecmp(argv[optind], "help")) { fprintf(stderr, "%s", usage);