mgcp: Add the disable color option to the mgcp binary

This commit is contained in:
Holger Hans Peter Freyther 2012-09-20 16:04:54 +02:00
parent 221ff66327
commit 778695d0b4
2 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,6 @@ Description=OpenBSC MGCP
[Service] [Service]
Type=simple Type=simple
Restart=always Restart=always
ExecStart=/usr/bin/osmo-bsc_mgcp -c /etc/osmocom/osmo-bsc-mgcp.cfg ExecStart=/usr/bin/osmo-bsc_mgcp -s -c /etc/osmocom/osmo-bsc-mgcp.cfg
Restart=always Restart=always
RestartSec=2 RestartSec=2

View File

@ -80,6 +80,7 @@ static void print_help()
printf("Some useful help...\n"); printf("Some useful help...\n");
printf(" -h --help is printing this text.\n"); printf(" -h --help is printing this text.\n");
printf(" -c --config-file filename The config file to use.\n"); printf(" -c --config-file filename The config file to use.\n");
printf(" -s --disable-color\n");
printf(" -D --daemonize Fork the process into a background daemon\n"); printf(" -D --daemonize Fork the process into a background daemon\n");
printf(" -V --version Print the version number\n"); printf(" -V --version Print the version number\n");
} }
@ -93,6 +94,7 @@ static void handle_options(int argc, char **argv)
{"config-file", 1, 0, 'c'}, {"config-file", 1, 0, 'c'},
{"daemonize", 0, 0, 'D'}, {"daemonize", 0, 0, 'D'},
{"version", 0, 0, 'V'}, {"version", 0, 0, 'V'},
{"disable-color", 0, 0, 's'},
{0, 0, 0, 0}, {0, 0, 0, 0},
}; };
@ -109,6 +111,9 @@ static void handle_options(int argc, char **argv)
case 'c': case 'c':
config_file = talloc_strdup(tall_bsc_ctx, optarg); config_file = talloc_strdup(tall_bsc_ctx, optarg);
break; break;
case 's':
log_set_use_color(osmo_stderr_target, 0);
break;
case 'V': case 'V':
print_version(1); print_version(1);
exit(0); exit(0);