ifupdown: add --force for compatibility with busybox ifupdown

This commit is contained in:
Ariadne Conill 2020-07-28 08:23:58 -06:00
parent 7af585e738
commit e1918f3fd5
3 changed files with 12 additions and 0 deletions

View file

@ -49,6 +49,7 @@ ifupdown_usage(void)
fprintf(stderr, " -n, --no-act do not actually run any commands\n"); fprintf(stderr, " -n, --no-act do not actually run any commands\n");
fprintf(stderr, " -v, --verbose show what commands are being run\n"); fprintf(stderr, " -v, --verbose show what commands are being run\n");
fprintf(stderr, " -E, --executor-path PATH use PATH for executor directory\n"); fprintf(stderr, " -E, --executor-path PATH use PATH for executor directory\n");
fprintf(stderr, " -f, --force force (de)configuration\n");
exit(1); exit(1);
} }
@ -127,6 +128,7 @@ ifupdown_main(int argc, char *argv[])
{"no-act", no_argument, 0, 'n'}, {"no-act", no_argument, 0, 'n'},
{"verbose", no_argument, 0, 'v'}, {"verbose", no_argument, 0, 'v'},
{"executor-path", required_argument, 0, 'E'}, {"executor-path", required_argument, 0, 'E'},
{"force", no_argument, 0, 'f'},
{NULL, 0, 0, 0} {NULL, 0, 0, 0}
}; };
struct match_options match_opts = {}; struct match_options match_opts = {};
@ -170,6 +172,8 @@ ifupdown_main(int argc, char *argv[])
case 'E': case 'E':
exec_opts.executor_path = optarg; exec_opts.executor_path = optarg;
break; break;
case 'f':
break;
} }
} }

View file

@ -18,6 +18,10 @@ configured in the configuration database.
*-a, --auto* *-a, --auto*
Only match interfaces that are marked as _auto_. Only match interfaces that are marked as _auto_.
*-f, --force*
Force deconfiguration of the interface.
This option exists for compatibility with other implementations.
*-h, --help* *-h, --help*
Display supported options to ifquery. Display supported options to ifquery.

View file

@ -18,6 +18,10 @@ configured in the configuration database.
*-a, --auto* *-a, --auto*
Only match interfaces that are marked as _auto_. Only match interfaces that are marked as _auto_.
*-f, --force*
Force configuration of the interface.
This option exists for compatibility with other implementations.
*-h, --help* *-h, --help*
Display supported options to ifquery. Display supported options to ifquery.