mirror of
https://github.com/Theldus/alertik.git
synced 2024-11-28 10:34:08 +01:00
Add commit hash on banner
This commit is contained in:
parent
4760bd2fbe
commit
18efb5f77e
6
Makefile
6
Makefile
@ -7,6 +7,7 @@ CC ?= cc
|
|||||||
CFLAGS += -Wall -Wextra
|
CFLAGS += -Wall -Wextra
|
||||||
LDLIBS += -pthread -lcurl
|
LDLIBS += -pthread -lcurl
|
||||||
STRIP = strip
|
STRIP = strip
|
||||||
|
VERSION = v0.1
|
||||||
|
|
||||||
ifeq ($(LOG_FILE),yes)
|
ifeq ($(LOG_FILE),yes)
|
||||||
CFLAGS += -DUSE_FILE_AS_LOG
|
CFLAGS += -DUSE_FILE_AS_LOG
|
||||||
@ -23,6 +24,11 @@ ifneq ($(CROSS),)
|
|||||||
LDFLAGS += -no-pie --static
|
LDFLAGS += -no-pie --static
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
GIT_HASH=$(shell git rev-parse --short HEAD 2>/dev/null || echo '$(VERSION)')
|
||||||
|
CFLAGS += -DGIT_HASH=\"$(GIT_HASH)\"
|
||||||
|
|
||||||
|
.PHONY: all clean
|
||||||
|
|
||||||
all: alertik Makefile
|
all: alertik Makefile
|
||||||
$(STRIP) --strip-all alertik
|
$(STRIP) --strip-all alertik
|
||||||
|
|
||||||
|
11
alertik.c
11
alertik.c
@ -442,21 +442,24 @@ int main(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!TELEGRAM_BOT_TOKEN || !TELEGRAM_CHAT_ID || !TELEGRAM_NICKNAME) {
|
if (!TELEGRAM_BOT_TOKEN || !TELEGRAM_CHAT_ID || !TELEGRAM_NICKNAME) {
|
||||||
panic("Unable to find env vars, please check if you have all of the"
|
panic("Unable to find env vars, please check if you have all of the "
|
||||||
"following set:\n"
|
"following set:\n"
|
||||||
"- TELEGRAM_BOT_TOKEN\n"
|
"- TELEGRAM_BOT_TOKEN\n"
|
||||||
"- TELEGRAM_CHAT_ID\n"
|
"- TELEGRAM_CHAT_ID\n"
|
||||||
"- TELEGRAM_NICKNAME\n");
|
"- TELEGRAM_NICKNAME\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
log_msg("Alertik v%s started...\n", ALERTIK_VERSION);
|
log_msg(
|
||||||
|
"Alertik (" GIT_HASH ") (built at " __DATE__ " " __TIME__ ")\n");
|
||||||
|
log_msg(" (https://github.com/Theldus/alertik)\n");
|
||||||
|
log_msg("-------------------------------------------------\n");
|
||||||
|
|
||||||
fd = create_socket();
|
fd = create_socket();
|
||||||
if (pthread_create(&handler, NULL, handle_messages, NULL))
|
if (pthread_create(&handler, NULL, handle_messages, NULL))
|
||||||
panic_errno("Unable to create hanler thread!");
|
panic_errno("Unable to create hanler thread!");
|
||||||
|
|
||||||
log_msg("Waiting for messages...\n");
|
log_msg("Waiting for messages at :%d (UDP)...\n", SYSLOG_PORT);
|
||||||
|
|
||||||
while (read_new_upd_msg(fd) >= 0);
|
while (read_new_upd_msg(fd) >= 0);
|
||||||
return (EXIT_SUCCESS);
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user