If no setting storage has been specified in the config, warn user
This commit is contained in:
parent
a652f09bcc
commit
ec9406de71
3 changed files with 22 additions and 1 deletions
11
htmlui.c
11
htmlui.c
|
@ -329,6 +329,17 @@ top_menu(http_connection_t *hc, tcp_queue_t *tq)
|
|||
|
||||
box_bottom(tq);
|
||||
tcp_qprintf(tq, "</div><br>\r\n");
|
||||
|
||||
if(sys_warning != NULL) {
|
||||
box_top(tq, "box");
|
||||
tcp_qprintf(tq,
|
||||
"<div class=\"content\">"
|
||||
"<span style=\"color:#aa3333;font-weight:bold\">"
|
||||
"Warning: %s</span></div>",
|
||||
sys_warning);
|
||||
box_bottom(tq);
|
||||
tcp_qprintf(tq, "</div><br>\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
11
main.c
11
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);
|
||||
|
|
1
tvhead.h
1
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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue