mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-14 00:10:10 -04:00
Add -b option to manually set the ffid
This commit is contained in:
parent
581b8df5c7
commit
840fe59997
14
src/main.c
14
src/main.c
@ -175,6 +175,7 @@ void usage(char *program) {
|
|||||||
printf(" -P <file> Write the PID ot specified file\n");
|
printf(" -P <file> Write the PID ot specified file\n");
|
||||||
printf(" -f Run in foreground\n");
|
printf(" -f Run in foreground\n");
|
||||||
printf(" -y Yes, go ahead and run as non-root user\n");
|
printf(" -y Yes, go ahead and run as non-root user\n");
|
||||||
|
printf(" -b <id> ffid to be broadcast\n");
|
||||||
printf("\n\n");
|
printf("\n\n");
|
||||||
printf("Valid debug modules:\n");
|
printf("Valid debug modules:\n");
|
||||||
printf(" config,webserver,database,scan,query,index,browse\n");
|
printf(" config,webserver,database,scan,query,index,browse\n");
|
||||||
@ -215,6 +216,7 @@ int main(int argc, char *argv[]) {
|
|||||||
char *db_type,*db_parms,*web_root,*runas, *tmp;
|
char *db_type,*db_parms,*web_root,*runas, *tmp;
|
||||||
char **mp3_dir_array;
|
char **mp3_dir_array;
|
||||||
char *servername, *iface;
|
char *servername, *iface;
|
||||||
|
char *ffid = NULL;
|
||||||
int index;
|
int index;
|
||||||
int appdir = 0;
|
int appdir = 0;
|
||||||
|
|
||||||
@ -234,11 +236,14 @@ int main(int argc, char *argv[]) {
|
|||||||
err_setlevel(debuglevel);
|
err_setlevel(debuglevel);
|
||||||
|
|
||||||
config.foreground=0;
|
config.foreground=0;
|
||||||
while((option=getopt(argc,argv,"D:d:c:P:mfrysiuva")) != -1) {
|
while((option=getopt(argc,argv,"D:d:c:P:mfrysiuvab:")) != -1) {
|
||||||
switch(option) {
|
switch(option) {
|
||||||
case 'a':
|
case 'a':
|
||||||
appdir = 1;
|
appdir = 1;
|
||||||
break;
|
break;
|
||||||
|
case 'b':
|
||||||
|
ffid=optarg;
|
||||||
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
debuglevel = atoi(optarg);
|
debuglevel = atoi(optarg);
|
||||||
err_setlevel(debuglevel);
|
err_setlevel(debuglevel);
|
||||||
@ -463,7 +468,12 @@ int main(int argc, char *argv[]) {
|
|||||||
if(tmp) free(tmp);
|
if(tmp) free(tmp);
|
||||||
|
|
||||||
srand((unsigned int)time(NULL));
|
srand((unsigned int)time(NULL));
|
||||||
txt_add(txtrecord,"ffid=%08x",rand());
|
|
||||||
|
if(ffid) {
|
||||||
|
txt_add(txtrecord,"ffid=%s",ffid);
|
||||||
|
} else {
|
||||||
|
txt_add(txtrecord,"ffid=%08x",rand());
|
||||||
|
}
|
||||||
|
|
||||||
DPRINTF(E_LOG,L_MAIN|L_REND,"Registering rendezvous names\n");
|
DPRINTF(E_LOG,L_MAIN|L_REND,"Registering rendezvous names\n");
|
||||||
iface = conf_alloc_string("general","interface","");
|
iface = conf_alloc_string("general","interface","");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user