From ec9406de714ed458b97f02d6697fbbb4a5296278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Thu, 14 Feb 2008 06:52:02 +0000 Subject: [PATCH] If no setting storage has been specified in the config, warn user --- htmlui.c | 11 +++++++++++ main.c | 11 ++++++++++- tvhead.h | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/htmlui.c b/htmlui.c index 18fe2ba1..9923cf1a 100644 --- a/htmlui.c +++ b/htmlui.c @@ -329,6 +329,17 @@ top_menu(http_connection_t *hc, tcp_queue_t *tq) box_bottom(tq); tcp_qprintf(tq, "
\r\n"); + + if(sys_warning != NULL) { + box_top(tq, "box"); + tcp_qprintf(tq, + "
" + "" + "Warning: %s
", + sys_warning); + box_bottom(tq); + tcp_qprintf(tq, "
\r\n"); + } } diff --git a/main.c b/main.c index 2ab45e05..d77bf0ed 100644 --- a/main.c +++ b/main.c @@ -61,6 +61,7 @@ int running; int xmltvreload; int startupcounter; const char *settings_dir; +const char *sys_warning; static pthread_mutex_t tag_mutex = PTHREAD_MUTEX_INITIALIZER; static uint32_t tag_tally; @@ -169,7 +170,15 @@ main(int argc, char **argv) openlog("tvheadend", LOG_PID, logfacility); - settings_dir = config_get_str("settings-dir", "/tmp/tvheadend"); + settings_dir = config_get_str("settings-dir", NULL); + + if(settings_dir == NULL) { + settings_dir = "/tmp/tvheadend"; + sys_warning = + "All channelsetup/recording info is stored in " + "'/tmp/tvheadend' and may not survive a system restart. " + "Please see the configuration manual for how to setup this correctly."; + } mkdir(settings_dir, 0777); snprintf(buf, sizeof(buf), "%s/channels", settings_dir); diff --git a/tvhead.h b/tvhead.h index a6286937..70a49e5d 100644 --- a/tvhead.h +++ b/tvhead.h @@ -836,5 +836,6 @@ uint32_t tag_get(void); extern const char *settings_dir; FILE *settings_open_for_write(const char *name); FILE *settings_open_for_read(const char *name); +extern const char *sys_warning; #endif /* TV_HEAD_H */